@authos/javascript
The JavaScript SDK is the core client library effectively used by the React SDK. It can be used directly in non-React environments.
Installation
npm install @authos/javascriptUsage
import { AuthOSClient } from '@authos/javascript';
const client = new AuthOSClient({
publishableKey: 'your_publishable_key',
apiUrl: 'http://localhost:3001/v1/client',
});
// Sign Up
await client.signUp({
email: 'user@example.com',
password: 'securePassword123',
name: 'John Doe',
});
// Sign In
const { user, token } = await client.signIn({
email: 'user@example.com',
password: 'securePassword123',
name: 'John Doe',
});
console.log('Logged in user:', user);Last updated on