Polaris Installation

System requirements:

  • Node.js 18 or later
  • macOS, Windows (including WSL), and Linux are supported.

Install the SDK:

Terminal
npm i -S @getpolaris.ai/sdk @getpolaris.ai/sdk-angular

Configure the SDK

To configure the SDK, you will need your app’s API Key. You can find the API Key by going to your app in Polaris and clicking on Settings.

app.config.ts
import { providePolaris } from '@getpolaris.ai/sdk-angular';

bootstrapApplication(AppComponent, {
  providers: [
    providePolaris({
      apiKey: API_KEY,
    }),
  ],
});

If your Angular application is module based, you can configure the SDK with the PolarisModule.

Angular
import { PolarisModule } from '@getpolaris.ai/sdk-angular';

@NgModule({
  imports: [
    PolarisModule.forRoot({
      apiKey: API_KEY,
    }),
  ],
})
export class AppModule {}