@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
Initialize the Scute client
First initialize the Scute client using thecreateClient method exposed by @scute/js-core package:
Create your main App component
Create your mainApp.svelte component that handles the authentication flow:
Create a Login component
Create aLoginForm.svelte component for handling user authentication:
Create a Profile component
Create aProfile.svelte component for authenticated users:
Additional Components
The example also includes additional components for handling different authentication flows:MagicVerify.svelte- For verifying magic link tokensMagicSent.svelte- Shows confirmation when magic link is sentOtpForm.svelte- For OTP verification (SMS/phone)RegisterDevice.svelte- For WebAuthn device registration
Running the Example
- Clone the example repository
- Copy
env.exampleto.envand add your credentials - Install dependencies:
npm install - Start the development server:
npm run dev
Core Methods
ThescuteClient provides several methods for authentication: