Create webapp SDK session
POST/v1/sessions
Create a browser-safe SafetyKit webapp SDK session token from server-side code before rendering pages that load the browser SDK. Provide at least one of customer_user_id or customer_session_hash. When customer_user_id is present, use the same canonical user ID string that you send as user_id in SafetyKit server-to-server events. The request must be authenticated with a valid Bearer token.
Create webapp SDK session
curl https://diagnostics.safetykit.com/v1/sessions \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $SAFETYKIT_API_KEY" \
-d '{
"customer_user_id": "user_12345",
"customer_session_hash": "session_hash_abc123"
}'{
"sdk_script_url": "https://cdn.sk-diagnostics.com/web/v1/sdk.js",
"session_token": "skst_v2_eyJ..."
}Returns Examples
{
"sdk_script_url": "https://cdn.sk-diagnostics.com/web/v1/sdk.js",
"session_token": "skst_v2_eyJ..."
}