From d1a33ab3cff8ee1321b9921864127ab1abd4915c Mon Sep 17 00:00:00 2001 From: Piotr Bochenek Date: Tue, 21 Nov 2023 21:02:46 +0100 Subject: [PATCH] format --- README.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 4ea89f0..1c343af 100644 --- a/README.md +++ b/README.md @@ -46,16 +46,15 @@ export class AppModule {} `main.ts` ```ts -import {bootstrapApplication} from '@angular/platform-browser'; -import {AppComponent} from './app/app.component'; -import {DescopeAuthConfig} from "@descope/angular-sdk"; +import { bootstrapApplication } from '@angular/platform-browser'; +import { AppComponent } from './app/app.component'; +import { DescopeAuthConfig } from '@descope/angular-sdk'; bootstrapApplication(AppComponent, { - providers: [ - {provide: DescopeAuthConfig, useValue: {projectId: ""}}, - ] + providers: [ + { provide: DescopeAuthConfig, useValue: { projectId: '' } } + ] }).catch((err) => console.error(err)); - ``` ### Use Descope to render specific flow @@ -155,6 +154,7 @@ export class AppComponent { ``` #### Standalone Mode Note: + All components in the sdk are standalone, so you can use them by directly importing them to your components. ### Use the `DescopeAuthService` and its exposed fields (`descopeSdk`, `session$`, `user$`) to access authentication state, user details and utilities @@ -246,6 +246,7 @@ export class AppModule {} ``` #### Standalone Mode Note: + You can use the same approach with `APP_INITIALIZER` in standalone mode, by adding it to `providers` array of the application. ### Descope Interceptor @@ -259,9 +260,9 @@ import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { - HttpClientModule, - provideHttpClient, - withInterceptors + HttpClientModule, + provideHttpClient, + withInterceptors } from '@angular/common/http'; import { DescopeAuthModule, descopeInterceptor } from '@descope/angular-sdk'; @@ -275,9 +276,7 @@ import { DescopeAuthModule, descopeInterceptor } from '@descope/angular-sdk'; pathsToIntercept: ['/protectedPath'] }) ], - providers: [ - provideHttpClient(withInterceptors([descopeInterceptor])) - ], + providers: [provideHttpClient(withInterceptors([descopeInterceptor]))], bootstrap: [AppComponent] }) export class AppModule {}