Resources > Troubleshooting
Resources > TroubleshootingKroxt BaaS SDK v1.0.5

Troubleshooting

Frequently encountered setup issues, error messages, and their solutions.

1. Invalid API key

Cause: The API key provided to the Kroxt constructor does not match the active project.

Solution: Verify that you are using the public client key (pk_dev_...) for frontend applications. Never expose your secret key (sk_dev_...) in client-side code.

2. CORS error in the browser

Cause: The request domain is not allowed to communicate with the Kroxt Gateway.

Solution: Go to the Kroxt Console $\rightarrow$ Project Settings $\rightarrow$ Allowed Origins, and add your local development domain (e.g., http://localhost:3000).

3. ProjectId not found

Cause: The `projectId` key passed to the SDK is missing or invalid.

Solution: Double check that the ID matches the string displayed on your project dashboard overview panel.

4. RLS: Forbidden on write

Cause: You are trying to insert records into a collection that restricts writes (e.g., rules set to Authenticated, but no Bearer token was attached).

Solution: Ensure your collection allows public writes if users are anonymous, or call `await baas.auth.login()` prior to writing to authenticated endpoints.

5. Failed to resolve collection metadata

Cause: The SDK cannot map the collection name to a database ID.

Solution: Go to the dashboard console and ensure that the collection name matches your SDK lookup call parameter exactly. If the collection was created recently, refresh your cache by calling await baas.metadataManager.forceRefresh().