This section describes how to integrate Eartho into an Angular app.
1. Install the SDK
You can install the SDK using npm or the Angular CLI.
Using npm:
npm install @eartho/one-client-angular
Using Angular CLI:
ng add @eartho/one-client-angular
2. Retrieve Eartho Client ID
Go to Eartho Creator and copy your Eartho client ID from the "Developers Integration" section.
3. Initialize and Configure the SDK
Integrate Eartho into your Angular app by configuring the SDK and handling authentication.
Example Code:
Import and Configure the SDK
// app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import the module from the SDK
import { AuthModule } from '@eartho/one-client-angular';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
// Import the module into the application, with configuration
AuthModule.forRoot({
clientId: 'YOUR_EARTHO_CLIENT_ID',
}),
],
bootstrap: [AppComponent],
})
export class AppModule {}