Socket
Book a DemoInstallSign in
Socket

@ns-gapi/instrumentation

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

@ns-gapi/instrumentation

GAPI Provider instrumentation library

1.4.6
latest
npmnpm
Version published
Weekly downloads
14
600%
Maintainers
1
Weekly downloads
 
Created
Source

Instrumentation

Basic usage

    const {ProviderApplication} = require('@ns-gapi/instrumentation/dist');
    const application = new ProviderApplication({
        key: 'application-key',
        env: 'sandbox',
    });

    // Application start will wait for developer key sync event
    await application.start();

    // Key provided by user for the request
    const developerKey = 'user-provided-key';

    // Developer key validation is sync as keys are cached locally
    if (!application.isValidDeveloperKey(developerKey)) {
        throw new Error('invalid key');
    }

    // Start transaction
    const transaction = application
        .startTransaction('transaction') // transaction type
        .withMetadata({custom: true}) // set some metadata
        .withDeveloperKey(developerKey);

    // finish transaction
    transaction.finish();

FAQs

Package last updated on 10 Jul 2020

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.