Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Bochenek committed Nov 21, 2023
1 parent cf7f59e commit d1a33ab
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: "<your_project_id>"}},
]
providers: [
{ provide: DescopeAuthConfig, useValue: { projectId: '<your_project_id>' } }
]
}).catch((err) => console.error(err));

```

### Use Descope to render specific flow
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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';

Expand All @@ -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 {}
Expand Down

0 comments on commit d1a33ab

Please sign in to comment.