A TypeScript Angular client for the omlox Hub API with Bearer authentication support.
- Native Angular services using HttpClient
- Bearer token authentication
- Full TypeScript support with typed models
- Observable-based API
npm install @kodira/omlox-client-typescript-angularimport { bootstrapApplication } from '@angular/platform-browser'
import { provideOmloxClient } from '@kodira/omlox-client-typescript-angular'
import { AppComponent } from './app/app.component'
bootstrapApplication(AppComponent, {
providers: [
provideOmloxClient({
baseUrl: 'https://your-omlox-hub.com/api',
}),
],
})import { OmloxClientModule } from '@kodira/omlox-client-typescript-angular'
@NgModule({
imports: [
OmloxClientModule.forRoot({
baseUrl: 'https://your-omlox-hub.com/api',
}),
],
})
export class AppModule {}import { Injectable, inject } from '@angular/core'
import { Observable } from 'rxjs'
import { OmloxTrackablesService, OmloxBaseService, Trackable } from '@kodira/omlox-client-typescript-angular'
@Injectable()
export class YourService {
private trackablesService = inject(OmloxTrackablesService)
private baseService = inject(OmloxBaseService)
setupAuth(token: string): void {
this.baseService.setBearerToken(token)
}
getTrackables(): Observable<Trackable[]> {
return this.trackablesService.getAllTrackables()
}
}OmloxTrackablesService- Trackable managementOmloxFencesService- Fence and collision managementOmloxZonesService- Zone managementOmloxProvidersService- Location provider managementOmloxBaseService- Base service with authentication
The client uses Bearer token authentication. Set the token using:
baseService.setBearerToken('your-jwt-token')The token will be automatically included in all subsequent API requests.
All omlox data models are fully typed:
import { Trackable, Fence, Zone, Location, TrackableMotion } from '@kodira/omlox-client-typescript-angular'