Skip to main content
If you would like to integrate Scute authentication with your Svelte app, you can do so using the @scute/js-core package. This approach gives you full control over the authentication flow and allows you to build custom UI components that match your app’s design. Head over to the example project repo to check out the complete Svelte example and see how all the components work together. To get started, install the Scute core SDK with your favorite package manager:
Terminal
Add your credentials to your environment variable handler:

Initialize the Scute client

First initialize the Scute client using the createClient method exposed by @scute/js-core package:

Create your main App component

Create your main App.svelte component that handles the authentication flow:

Create a Login component

Create a LoginForm.svelte component for handling user authentication:

Create a Profile component

Create a Profile.svelte component for authenticated users:

Additional Components

The example also includes additional components for handling different authentication flows:
  • MagicVerify.svelte - For verifying magic link tokens
  • MagicSent.svelte - Shows confirmation when magic link is sent
  • OtpForm.svelte - For OTP verification (SMS/phone)
  • RegisterDevice.svelte - For WebAuthn device registration
You can find the complete implementation of these components in the example repository.

Running the Example

  1. Clone the example repository
  2. Copy env.example to .env and add your credentials
  3. Install dependencies: npm install
  4. Start the development server: npm run dev
Congrats! You now have a working Scute authentication system in your Svelte app!

Core Methods

The scuteClient provides several methods for authentication:

signInOrUp(identifier: string)

Initiates the sign-in or sign-up process with an email or phone number.

getSession()

Retrieves the current user session and user data.

signOut()

Signs out the current user and clears the session.

getMagicLinkToken()

Extracts magic link tokens from the current URL for verification. Verifies a magic link token and completes authentication. For more methods and detailed API documentation, check out the type docs.