ComposioHQ/composio · error · ValidationError
Failed to parse SDK realtime credentials
Error message
Failed to parse SDK realtime credentials
What it means
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.
Source
Thrown at ts/packages/core/src/services/internal/InternalService.ts:43
*/
async getSDKRealtimeCredentials(): Promise<SDKRealtimeCredentialsResponse> {
const response = await this.client.request<ComposioSDKRealtimeCredentialsResponse>({
method: 'get',
path: SDK_REALTIME_CREDENTIALS_ENDPOINT,
});
const parsedResponse = SDKRealtimeCredentialsResponseSchema.safeParse({
pusherKey: response.pusher_key,
projectId: response.project_id,
pusherCluster: response.pusher_cluster,
});
logger.debug(
`[InternalService] SDK realtime credentials: ${JSON.stringify(parsedResponse, null, 2)}`
);
if (!parsedResponse.success) {
throw new ValidationError(`Failed to parse SDK realtime credentials`, {
cause: parsedResponse.error,
});
}
return parsedResponse.data;
}
}
View on GitHub (pinned to 64b1b85502)
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
Defensive patterns
Strategy: try-catch
Type guard
import { ValidationError } from '@composio/core';
function isCredentialParseError(e: unknown): e is ValidationError {
return e instanceof ValidationError && /realtime credentials/.test(e.message);
} Try / catch
try { await internalService.getSDKRealtimeCredentials(); } catch (e) { if (isCredentialParseError(e)) { console.error('Credential parse failed:', e.cause); } throw e; } Prevention
- Keep SDK and backend versions in sync
- Validate API key with a simple SDK call first
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- experimental_subAgent() schema must be a Zod schema or JSON
- Invalid arguments for local tool ${resolution.finalSlug}: ${
- Failed to parse manage connections config
- Failed to parse auth config create options
- Failed to parse auth config update data
AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28).
Data as JSON: /api/errors/d41dc8ffe674e1c2.
Report an issue: GitHub.