Skip to content
ngx-globus-sdk / 0.0.1

ngx-globus-sdk 0.0.1

Install from the command line:
Learn more about npm packages
$ npm install @usnistgov/ngx-globus-sdk@0.0.1
Install via package.json:
"@usnistgov/ngx-globus-sdk": "0.0.1"

About this version

NgxGlobusSdk

NgxGlobusSdk is a library that enables you to easily work with Globus and its APIs. So far, the SDK only allows interaction with the Auth and Transfer APIs.

This project was generated with Angular CLI version 13.3.5.

How to install

Install from the command line:

npm install @usnistgov/ngx-globus-sdk@0.0.1

Install via package.json:

"@usnistgov/ngx-globus-sdk": "0.0.1"

How to use

Import the the NgxGlobusSdkModule module and add it to your app.module.ts imports:

import { NgxGlobusSdkModule } from 'ngx-globus-sdk';

@NgModule({
  ...
    imports: [
        ...
        NgxGlobusSdkModule.forRoot({
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET",
        ...
        })
    ],
...
})

export class AppModule {
}

then import the NgxGlobusSdkService service, and inject it into a constructor:

import { NgxGlobusSdkService } from 'ngx-globus-sdk';

...
constructor(private globusService: NgxGlobusSdkService)
{
  ...
  let authUrl = this.globusService.getAuthorizeUrl();
  ...
}

Configuration

The module expects the following configuration interface:

export interface Configuration {
    clientId: string;
    clientSecret: string;
    redirectUrl: string;
    scope?: string;
    authorizeUrl?: string;
    tokenUrl?: string;
}

where:

  • clientId, and clientSecret are provided by Globus when first registering and creating the app. These should be hidden in env variables.
  • redirectUrl is the url to redirect the user to after a login. This is specified by the app developer during app creation and registration.
  • scope the scopes that the app has access to. Defaults to "openid profile email".
  • authorizeUrl is the OAuth2 authorization endpoint. Defaults to "https://auth.globus.org/v2/oauth2/authorize".
  • tokenUrl is the endpoint used to exchange an authorization code for an access token. Defaults to "https://auth.globus.org/v2/oauth2/token".

Contributing

Check CONTRIBUTING.md

License

Check LICENSE

Details


Assets

  • ngx-globus-sdk-0.0.1-npm.tgz

Download activity

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

Recent versions

View all