@obelisk/client
Advanced tools
Comparing version 1.0.0-ngx.0 to 2.0.0-alpha.0
{ | ||
"name": "@obelisk/client", | ||
"version": "1.0.0-ngx.0", | ||
"version": "2.0.0-alpha.0", | ||
"description": "Typescript client to interact with Obelisk on a higher level than with regular ReST API calls.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -28,3 +28,3 @@ # Obelisk Client | ||
```bash | ||
npm install obelisk-client rxjs --save | ||
npm install @obelisk/client rxjs --save | ||
``` | ||
@@ -36,4 +36,3 @@ | ||
```typescript | ||
import { IotClient } from 'obelisk-client'; | ||
import { ClientOptions } from 'obelisk-client/lib/interfaces'; | ||
import { ClientOptions, IotClient } from '@obelisk/client'; | ||
@@ -60,36 +59,8 @@ // Create shareable observable. (caches the client object) | ||
## Angular | ||
*If you are logged in it will handle all the tokens in the headers for you.* | ||
This client also exposes an angular Module and Service that you can use. | ||
To include it in you main AppModule, do this: | ||
[full-docs]: https://obelisk.ilabt.imec.be/api/v1/client-docs | ||
```typescript | ||
import { ObeliskClientModule, ObeliskService } from 'obelisk/ngx'; | ||
## Angular | ||
const options: ClientOptions = { | ||
host: 'https://obelisk.ilabt.imec.be', | ||
apiVersion: 'v1', | ||
realm: 'idlab-iot', | ||
clientId: 'my-client' | ||
} | ||
@NgModule({ | ||
declarations: [...], | ||
imports: [ | ||
..., | ||
ObeliskClientModule.forRoot(options) | ||
], | ||
providers: [ | ||
ObeliskService, | ||
... | ||
], | ||
bootstrap: [AppComponent] | ||
}) | ||
export class AppModule { } | ||
``` | ||
Now you can inject ObeliskService and get an already initialized client from it any time. | ||
*If you are logged in it will handle all the tokens in the headers for you.* | ||
[full-docs]: https://obelisk.ilabt.imec.be/api/v1/client-docs | ||
There is an optional angular package to use in conjunction with the client packages. More information can be found at [@obelisk/ngx](https://www.npmjs.com/package/@obelisk/ngx). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74685
64