kinvey-angular-sdk
TypeScript icon, indicating that this package has built-in type declarations

9.0.0 • Public • Published

Kinvey Angular SDK

Installation

From the command prompt go to your app's root folder and execute:

npm i kinvey-angular-sdk@next

Usage

Import the KinveyModule in your app.module.ts like this to initialize the SDK:

import { NgModule } from '@angular/core';
import { KinveyModule } from 'kinvey-angular-sdk';

@NgModule({
  imports: [
    KinveyModule.init({
      appKey: '<yourAppKey>',
      appSecret: '<yourAppSecret>'
    })
  ]
})
export class AppModule { }

Then you can use dependency injection to inject a Kinvey service in your module like this:

import { Component } from '@angular/core';
import { UserService } from 'kinvey-angular-sdk';

@Component()
export class AppComponent {
  constructor(private userService: UserService) {}

  async login() {
    try {
      const user = await this.userService.login('<username>', '<password>');
      console.log(user);
    } catch (error) {
      console.log(error);
    }
  }
}

The following services are available to use with dependency injection:

  • DataStoreService
  • EndpointService
  • FilesService
  • PingService
  • UserService

Build

If you would like to build the SDK yourself, clone the monorepo, then:

  • npm i
  • npm run build

You can then install the SDK build by running npm i /<localpath>/packages/angular-sdk

Package Sidebar

Install

npm i kinvey-angular-sdk

Weekly Downloads

8

Version

9.0.0

License

Apache-2.0

Unpacked Size

42.4 kB

Total Files

31

Last publish

Collaborators

  • kinvey
  • dimofeev
  • tsakata1