New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@collaborizm/apimarket

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@collaborizm/apimarket

Community supported, client library for AT&T API Marketplace

  • 0.0.14
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by25%
Maintainers
1
Weekly downloads
 
Created
Source

AT&T API Marketplace - Community Nodejs Client

npm version

Get started with the new API Marketplace at https://apimarket.att.com

Clone the examples! https://github.com/rlancer/apimarket-examples

Install

$ npm i @collaborizm/apimarket

Built with Typescript, types included!

Authentication

Library automatically refreshes access tokens, no need to worry about testing for token expiration.

 import { APIMarketplaceClient } from '@collaborizm/apimarket'

 // for user authentication 
 const apiMarketplaceClient = new APIMarketplaceClient({
                                   username: '<USERNAME>',
                                   password: '<PASSWORD>',
                                   grant_type: 'password',
                                   client_id: '<CLIENT_ID>',
                                   scope: 'openid'
                                 })
 
 // for project authentication                                                           
 const apiMarketplaceClient = new APIMarketplaceClient({
                                   grant_type: 'client_credentials',
                                   client_id: '<CLIENT_ID>',
                                   client_secret: '<CLIENT_SECRET>',
                                   scope: 'openid'
                                 })
 
 // returns and object { id_token, access_token, id_token_decoded})          

Usage with API Marketplace Javascript SDK


// Execute authentication on server

// getValidToken will automatically refresh your access token if it's about to expire  
const tokenFromServer = await apiMarketplaceClient.getValidToken() 

// Include JS SDK included on client  
const kandy = Kandy.create({
  logs: {
    logLevel: 'debug'
  },
  authentication: {
    server: {
      base: 'oauth-cpaas.att.com'
    },
    clientCorrelator: 'sampleCorrelator'
  }
})

const { id_token, access_token } = authenticateProject

this.kandy.setTokens({ idToken: id_token, accessToken: access_token })

Simple send SMS message

Creates a communication channel if one doesn't exist and sends an SMS

  await apiMarketplaceClient.simpleSmsSend({
    toAddress: '+15555555555',
    fromAddress: '<ADDRESS_MUST_BE_PROVISIONED>',
    message: 'Hey',
    callbackUrl: 'http://example.com/callback'
  })

REST API Methods

If you'd like to use any of the standard REST api methods, they're all here too

  await apiMarketplaceClient.sendSMS({
    toAddress: '+15555555555',
    fromAddress: '<ADDRESS_MUST_BE_PROVISIONED>',
    message: 'Hey',
    clientCorrelator: '<FROM COMMUNICATION CHANNEL>'
  })

Keywords

FAQs

Package last updated on 07 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc