API Reference
auth API
Learn how to authenticate users securely in your Replit extensions using the auth API module. Get and verify JWT tokens for user authentication.
auth API experimental
The auth
api module allows you to securely authenticate a Replit user if they use your extension.
Usage
Methods
auth.getAuthToken
Returns a unique JWT token that can be used to verify that an extension has been loaded on Replit by a particular user
auth.verifyAuthToken
Verifies a provided JWT token and returns the decoded token.
auth.authenticate
Performs authentication and returns the user and installation information
Types
AuthenticatedUser
Property | Type |
---|---|
id | number |
AuthenticateResult
Property | Type |
---|---|
installation | AuthenticatedInstallation |
user | AuthenticatedUser |
Was this page helpful?