Angular Quickstart
This guide will only include the frontend integration. If you would like to also handle Session Management in your backend, select your backend technology below:
This is a quickstart guide to help you integrate Descope with your Angular application. Follow the steps below to get started.
Install Frontend SDK
Install the SDK with the following command:
Then, add Descope type definitions to your tsconfig.ts
Import and Wrap Application with Descope Angular SDK
Start by importing Descope then add the Angular SDK to your application. You will need your Project ID from Project Settings in the Descope Console.
Note
You can also add the optional baseUrl
parameter if you're utilizing a CNAME within your Descope project (ex: https://auth.company.com
).
Import Descope Functions and Add Flows Component
To trigger the Descope Flow, you will need to add this component in your Angular template. The screens you've customized in your Flow will appear here. You can also customize the component with the following:
flowId
: ID of the flow you wish to useonSuccess
andonError
: functions that execute when authentication succeeds or fails
Note
For the full list of component customization options, refer to our Descope Components Customization Doc.
Utilize the Angular SDK Hooks and Functions
Descope provides many different hooks to check if the user is authenticated, session is loading etc. You can use these to customize the user experience:
isAuthenticated
: Boolean for the authentication state of the current user session.user
: Returns information about the currently authenticated user.logout()
: Logs out the currently authenticated user.
Note
For the full list of available hooks and functions, refer to the Auth Helpers Doc.
At this point, you're done with the frontend. If you would like to also handle Session Management in your backend, keep on reading!
Continue with Backend SDK
If you would like to also handle Session Management in your backend, keep on reading by selecting your backend technology below:
Checkpoint
Your application is now integrated with Descope. Please test with sign-up or sign-in use case.
Customize
Now that you have the end-to-end application working, you can choose to configure and personalize many different areas of Descope, including your brand, style, custom user authentication journeys, etc. We recommend starting with customizing your user-facing screens, such as signup and login.