Socket
Socket
Sign inDemoInstall

nordnet-next-api

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nordnet-next-api

Nordnet nExt API Javascript client


Version published
Weekly downloads
48
increased by77.78%
Maintainers
1
Weekly downloads
 
Created
Source

Nordnet nExt API Javascript client

Isomorphic JS client for Nordnet nExt API. Client can be used both on the client and server side. Client should be used for making HTTP requests towards nExt API. See nExt API documentation for a list of possible requests.

Installation

NPM

npm install --save nordnet-next-api

Usage

Library can be used on the client and server side.

import api from 'nordnet-next-api';

api
  .get('https://api.test.nordnet.se/next/2')
  .then(response => console.log(response));
var api = require('nordnet-next-api');
var express = require('express');
var app = express();

app.get('/', function (req, res) {
  api.get('https://api.test.nordnet.se/next/2')
    .then(function(response) {
      res.send(response);
  })
});

Basic usage

import api from 'nordnet-next-api';

api.get('https://api.test.nordnet.se/next/2/accounts/{accno}', { accno: 123456789 })
  .then(response => console.log(response));

Passing path parameters

import api from 'nordnet-next-api';

api.get('https://api.test.nordnet.se/next/2/accounts/{accno}', { accno: 123456789 })
  .then(response => console.log(response));

Passing POST parameters

import api from 'nordnet-next-api';

api.get('https://api.test.nordnet.se/next/2/user/{key}', { key: 'foo', value: { bar: 'bar' }})
  .then(response => console.log(response));

Passing additional headers

import api from 'nordnet-next-api';

api.get('https://api.test.nordnet.se/next/2/markets/{market_id}', { market_id: 80 }, { 'Accept-Language': 'sv' })
  .then(response => console.log(response));

See tests under src/__tests__ for more examples.

Example projects

nordnet-next-api is distributed with a two simple example projects.

First, build the project:

npm run build

Run the client side example:

cd examples/client
npm install
npm start

Run the server side example:

cd examples/server
npm install
npm start

License

All open source code released by Nordnet is licenced under the MIT licence.

Keywords

FAQs

Package last updated on 27 Jul 2015

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