
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
ordercloud-angular-sdk
Advanced tools
This Angular 1.xx SDK is a wrapper for the OrderCloud Javascript SDK which is auto-generated from our Swagger Spec
If you're new to ordercloud check out our documentation.
Additional SDK specific documentation can be found here
bower install ordercloud-angular-sdk --save
angular.module('YOUR_MODULE', ['ordercloud-angular-sdk'])
The SDK exposes OrderCloudSDK.Config
to configure settings required to run. It receives the following parameters:
We recommend setting these in a run block like so:
angular.module('YOUR_MODULE', ['ordercloud-javascript-sdk'])
.run(function(OrderCloudSDK){
var cookiePrefix = 'COOKIE_PREFIX_EXAMPLE'; // this can be any string - in the starter app we use the appname
var apiVersion = 'v1'; //there is currently only one version of the API
var apiurl = 'https://api.ordercloud.io'
var authurl = 'https://auth.ordercloud.io'
OrderCloudSDK.Config(cookiePrefix, apiurl + '/' + apiVersion, authurl);
})
In addition to the standard methods provided via the Javascript SDK, the following methods are added to allow you to interact with tokens (stored in cookies) for a user as well as an impersonated user.
OrderCloudSDK.GetToken();
OrderCloudSDK.SetToken(tokenToSet);
OrderCloudSDK.RemoveToken();
OrderCloudSDK.GetRefreshToken();
OrderCloudSDK.SetRefreshToken(tokenToSet);
OrderCloudSDK.GetImpersonationToken();
OrderCloudSDK.SetImpersonationToken(tokenToSet);
OrderCloudSDK.RemoveImpersonationToken();
The following example will show you how to:
var username = 'user123';
var password = 'foobar'
var clientid = '7FC87166-D42A-4F2D-9587-159D98156314' //you can find your app's client id in the [dashboard](https://developer.ordercloud.io/dashboard/applications)
var scope = ['FullAccess']; //this is an array of roles (permissions) being requested. More info on roles [here](https://developer.ordercloud.io/documentation/platform-guides/authentication/security-profiles)
OrderCloudSDK.Auth.Login(username, password, clientid, scope)
.then(function(response){
var token = response['access_token'];
OrderCloudSDK.SetToken(token); //this token is now stored in browser cookies and will be used on any subsequent API call
OrderCloudSDK.Me.Get()
.then(function(currentUser){
console.log('This user's name is ' + currentUser.FirstName + ' ' + currentUser.LastName);
})
})
Be sure to check out our API documentation.
Additional SDK specific documentation can be found here
FAQs
Wrapper for OrderCloud-Javascript-SDK
The npm package ordercloud-angular-sdk receives a total of 0 weekly downloads. As such, ordercloud-angular-sdk popularity was classified as not popular.
We found that ordercloud-angular-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.