{"record":{"id":"d41dc8ffe674e1c2","repo":"ComposioHQ/composio","slug":"failed-to-parse-sdk-realtime-credentials","errorCode":null,"errorMessage":"Failed to parse SDK realtime credentials","messagePattern":"Failed to parse SDK realtime credentials","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/services/internal/InternalService.ts","lineNumber":43,"sourceCode":"   */\n  async getSDKRealtimeCredentials(): Promise<SDKRealtimeCredentialsResponse> {\n    const response = await this.client.request<ComposioSDKRealtimeCredentialsResponse>({\n      method: 'get',\n      path: SDK_REALTIME_CREDENTIALS_ENDPOINT,\n    });\n\n    const parsedResponse = SDKRealtimeCredentialsResponseSchema.safeParse({\n      pusherKey: response.pusher_key,\n      projectId: response.project_id,\n      pusherCluster: response.pusher_cluster,\n    });\n\n    logger.debug(\n      `[InternalService] SDK realtime credentials: ${JSON.stringify(parsedResponse, null, 2)}`\n    );\n\n    if (!parsedResponse.success) {\n      throw new ValidationError(`Failed to parse SDK realtime credentials`, {\n        cause: parsedResponse.error,\n      });\n    }\n\n    return parsedResponse.data;\n  }\n}\n","sourceCodeStart":25,"sourceCodeEnd":51,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/services/internal/InternalService.ts#L25-L51","documentation":"InternalService.getSDKRealtimeCredentials fetched realtime (Pusher) credentials from the Composio backend, and the response body failed Zod (or equivalent) schema validation. The SDK wraps this as a ValidationError with the parse error as `cause`, meaning the server responded but with an unexpected shape.","triggerScenarios":"Calling composio.triggers or any realtime/listener API that lazily initializes the Pusher client; the backend returns a credential payload whose fields (key, cluster, channel, etc.) don't match SDKRealtimeCredentialsResponse, or an HTML/JSON error page is returned instead.","commonSituations":"Version skew between an old @composio/core and a changed backend credential response; expired/invalid API key causing a non-credential error body to be parsed as credentials; backend outage returning an error page; custom API base URL pointing at a proxy.","solutions":["Inspect parsedResponse.error / the `cause` to see which field failed validation and compare with your SDK version","Upgrade @composio/core to the latest version so the credential schema matches the current backend","Verify your API key and backendUrl configuration return a valid credential response"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"import { ValidationError } from '@composio/core';\nfunction isCredentialParseError(e: unknown): e is ValidationError {\n  return e instanceof ValidationError && /realtime credentials/.test(e.message);\n}","tryCatchPattern":"try { await internalService.getSDKRealtimeCredentials(); } catch (e) { if (isCredentialParseError(e)) { console.error('Credential parse failed:', e.cause); } throw e; }","preventionTips":["Keep SDK and backend versions in sync","Validate API key with a simple SDK call first"],"tags":["validation","realtime","credentials","zod"],"backgroundTag":"schema-validation-failed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}