Skip to main content
PowerSync allows generating temporary development tokens for authentication. This is useful for developers who want to get up and running quickly, without full auth integration. This can also be used to generate a token for a specific user to debug issues.

Generating a Development Token

  1. In the PowerSync Dashboard, select your project and instance
  2. Go to the Client Auth view
  3. Check the Development tokens setting and save your changes
  4. Click the Connect button in the top bar
  5. Enter a user ID:
    • If you’re only using global Sync Rules / Streams, you can enter any value (e.g., test-user) since all data syncs to all users
    • If you’re using any Sync Rules / Streams that filter data by user, enter a user ID that matches a user in your database. The user ID will be used as request.user_id() in your Sync Rules or auth.user_id() in Sync Streams.
  6. Click Generate Token and copy the token
Development tokens expire after 12 hours.

Usage

Development tokens can be used for testing purposes either with the Sync Diagnostics Client, the test-client, or your app itself (for development purposes).

Using with Sync Diagnostics Client

The Sync Diagnostics Client allows you to quickly test syncing and inspect a user’s SQLite database, to verify that your PowerSync Service configuration and Sync Rules / Streams behave as expected.
  1. Open the Sync Diagnostics Client
  2. Enter the generated development token at PowerSync Token.
  3. Enter your PowerSync Service endpoint URL at PowerSync Endpoint unless already prepopulated.
  4. Click Proceed.
  5. Wait for the syncing to complete and inspect the synced data in SQLite.

Using with test-client

The test-client is useful for testing of syncing without persisting anything to a client-side SQLite database. Amongst other things, it can be used for load testing, simulating many client syncing concurrently. Consult the README for details on how to provide the development token as argument to test-client supported commands.

Using with Your Application

To use the temporary development token in your application, update the fetchCredentials() function in your backend connector to return the generated token.
async fetchCredentials(): Promise<PowerSyncCredentials> {
  // for development: use development token
  return {
    endpoint: 'https://your-instance.powersync.com',
    token: 'your-development-token-here'
  };
}