caste-client-ng 1.2.21
Install from the command line:
Learn more about npm packages
$ npm install @qbitartifacts/caste-client-ng@1.2.21
Install via package.json:
"@qbitartifacts/caste-client-ng": "1.2.21"
About this version
This project is an Angular client for Caste
This is a work in progress
For a full example see: example project
You can follow the instructions here
First, you will need to authenticate against Github npm packages to be able to install package, see this
You can either add a dependency to your package.json, change to the latest version.
{
"dependencies": {
...
"@qbitartifacts/caste-client-ng": "<latest_version>"
}
}
Or install from cmd:
$ npm install @qbitartifacts/caste-client-ng
To get started add this to your projects AppModule
// app.module.ts
import {
CasteAuthModule,
CASTE_AUTH_CONFIG,
} from '@qbitartifacts/caste-client-ng';
// Provide Caste config
const qbitCasteConfigProvider = {
provide: CASTE_AUTH_CONFIG,
useValue: {
realm: 'default',
url: 'https://api.caste.qbitartifacts.com',
},
};
@NgModule({
imports: [CasteAuthModule, /* and other modules */],
providers: [qbitCasteConfigProvider]
});
- The realm is the identifier of your application.
import {
CasteAuthService,
} from '@qbitartifacts/caste-client-ng';
@Component(...)
export class AppComponent {
constructor(
public qbitAuth: CasteAuthService,
) {
const signInReq = this.qbitAuth.signIn({
username: 'username',
password: 'password',
realm: 'realm',
}).subscribe(
(resp) => {
console.log('resp', resp);
},
(error: ApiError) => {
console.log('error', error);
}
);
}
}
Import this module if you need auth.
import { CasteAuthModule } from '@qbitartifacts/caste-client-ng';
Import this module if you need management.
import { CasteManagementModule } from '@qbitartifacts/caste-client-ng';
This service offers authentication methods, ie: login, signup, etc.
import { CasteAuthService } from '@qbitartifacts/caste-client-ng';
This service manages calls for authentcated user
import { CasteUserService } from '@qbitartifacts/caste-client-ng';
import { CasteUsersService } from '@qbitartifacts/caste-client-ng';
import { CasteAccountsService } from '@qbitartifacts/caste-client-ng';
import { CasteApplicationsService } from '@qbitartifacts/caste-client-ng';
import { CastePermissionsService } from '@qbitartifacts/caste-client-ng';
Coverage reports:
This library was generated with Angular CLI version 8.2.14.