Boundless Meraki SDK for Node
This package allows you to interact with the (Meraki Dashboard API)[https://developer.cisco.com/meraki/api/overview/#api-version] from a Javascript application (Node or Browser).
If using it from a browser, you will need to point the host to an API Gateway that supports CORS, such as the Boundless API Gateway
Installation
Install this package by running
yarn add @boundlessdigital/meraki-sdk
Once installed, you can use it in your application by instantiating the client, configuring your API Key, and then calling the API methods on the client directly.
The API Key should be stored in your environment using the MERAKI_DASHBOARD_API_KEY environment variable. If you use this variable, then you don't need to explicitly configure the key, as it will be automatically detected.
You have several additional options for configuring the client:
host - defines the backend endpoint that requests will be sent to. Defaults to `api.meraki.com`. You can change this to point to an API Gateway
base_path - defaults to `/api/v1`
retry_on_error: boolean - Set to `true`to have the client automatically retry on errors, following hte retry policy
maximum_retries: number - Defaults to 5
retry_on_statuses: number[] - Defaults to 429 and 503
Action Batches
You can use the Meraki Action Batch feature by preparing the batches, and executing them once the work has ben batched.
The client operates in 3 request modes: "preview", "dispatch", or "batch"
the Preview mode results hte action to the caller, fro use elsewhere. This is useful if you want ot manage your own actions and batces
dispath mode executes hte requests immediately, and ignores the action batching.
bath mode saves all requests into a mega task list, and then intelligently executes this
Developing
import { Client } from '@boundlessdigital/meraki-sdk'
const client = new Meraki({
api_key: API_KEY,
maximum_retries: 5
})
await client.get_organizations()