Session tokens
In the TypeScript SDK, session tokens are the short-lived credentials that CSVImporter uses to keep the importer authenticated in the browser without exposing your long-lived secret key.
Implement getSessionToken() so it returns a fresh token from your backend:
Never expose the secret to the browser
Client code should only receive short-lived session tokens from your backend. If the secret is exposed, rotate it in the ExpressCSV dashboard and update your backend.
Choose the right environment key
Use the secret key for the environment where the importer will run.
-
Production
- Use for: live imports in your production deployment
- Plan requirement: paid plan required
- Usage: counts toward usage limits
- Import behavior: full live imports
-
Development
- Use for: local development, staging, and CI deployments
- Plan requirement: available on all teams
- Usage: unlimited test imports
- Import behavior: returns only the first 100 rows and shows a test mode banner
How to implement the session endpoint
Your backend session endpoint should:
- Call the Create Import Session Token REST API with your environment secret key
- Return only the resulting
tokento the browser
The example below uses Hono, but the same pattern applies in any backend framework.