Skip to content

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

Caste Client (Angular)

This project is an Angular client for Caste

This is a work in progress

Table Of Contents

Getting Started

For a full example see: example project

Install

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

Setup

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.

Basic Usage

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);
            }
        );
    }
}

Exported Modules

CasteAuthModule

Import this module if you need auth.

import { CasteAuthModule } from '@qbitartifacts/caste-client-ng';

CasteManagementModule

Import this module if you need management.

import { CasteManagementModule } from '@qbitartifacts/caste-client-ng';

Exported Services

CasteAuthService

This service offers authentication methods, ie: login, signup, etc.

import { CasteAuthService } from '@qbitartifacts/caste-client-ng';

CasteUserService

This service manages calls for authentcated user

import { CasteUserService } from '@qbitartifacts/caste-client-ng';

CasteUsersService

import { CasteUsersService } from '@qbitartifacts/caste-client-ng';

CasteAccountsService

import { CasteAccountsService } from '@qbitartifacts/caste-client-ng';

CasteApplicationsService

import { CasteApplicationsService } from '@qbitartifacts/caste-client-ng';

CastePermissionsService

import { CastePermissionsService } from '@qbitartifacts/caste-client-ng';

Status

Coverage reports:

This library was generated with Angular CLI version 8.2.14.

Details


Assets

  • caste-client-ng-1.2.21-npm.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0