Angular
Angular SDK reference
Installation
Run npm install @rownd/angular
or yarn add @rownd/angular
Usage
The library provides an Angular Module and Service for dependency injection.
In the main app.module.ts file, add the Rownd module. You’ll also need to
include the @ngrx/store
module as well, as Rownd will drive state updates
through it.
Module params
API Reference
requestSignIn()
Trigger the Rownd sign-in dialog. This accepts an optional parameter with options to control the behavior of the sign in. See our SDK Docs for a full list of supported options.
-
auto_sign_in
: boolean - when true, automatically trigger a sign-in attempt if identifier is included or an email address or phone number has already been set in the user data. -
identifier
: string - an email address or phone number (in E164 format) to which a verification message may be sent. If the Rownd app is configured to allow unverified users, then sign-in will complete without verification if the user has not signed in previously. -
post_login_redirect
: string - at the conclusion of a successful sign in, Rownd will redirect the user here. This can be a path on the current domain or a full URL.
signOut()
Signs out the current user and clears their profile, returning them to a completely unauthenticated state.
getAccessToken()
Get the current user’s access token.
waitForToken
: boolean - when true, if no access token is present or if it’s expired, the promise will not be resolved until a valid token is available. While unlikely, this could result in waiting forever.
isAuthenticated$
An observable boolean that indicates whether the user is currently signed in.
user$
An observable object that represents information about the current user, specifically their profile information. The schema will match whatever you define in the Rownd Platform. See our documentation for more information on configuring this schema.
isInitializing$
An observable boolean that will be true
until Rownd has fully loaded and
resolved the current user’s authentication status. This usually takes only a few
milliseconds, but if you make decisions that depend on the isAuthenticated$
value while isInitializing$
is still true
, your code/logic may not work as
you expect.