New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

bima-shark-sdk

Package Overview
Dependencies
Maintainers
4
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bima-shark-sdk

This is the Javascript SDK for the BImA applications.

latest
Source
npmnpm
Version
3.3.0
Version published
Weekly downloads
69
16.95%
Maintainers
4
Weekly downloads
 
Created
Source

bima-shark-sdk (Javascript)

This is the Javascript SDK for the BImA applications.

Build Status

Installation

  • Install the npm package
npm install bima-shark-sdk
  • Bring your own fetch library.
  • In browser you have to use babel-loader to support IE 11 and project-wide babel.config.js. A .babelrc configuration is not enough and will ignore node_modules.
  // webpack.config.js
    module: {
      rules: [
        {
          test: /\.js$/,
          include: [
            path.resolve(__dirname, 'src'),
            path.resolve(__dirname, 'node_modules/bima-shark-sdk')
          ],
          use: {
            loader: 'babel-loader'
          }
        },
        ...

Usage

In browser

import Shark from 'bima-shark-sdk'

Shark.configure({
  debug: false,             // log request and response, when true
  secret: 'random-id',      // user specific secret e.g. id
  serviceTokenUrl: '/doorkeeper/service_token'
})

import { UserClient } from 'bima-shark-sdk'

const client = new UserClient('https://doorkeeper-development.bundesimmo.de')
client.find(123)
  .then(
    json => { console.log('Success: ', json) },
    err => { console.log('Error: ', err) }
  ).finally(
    () => { console.log('Hide loader') }
  )

In Node.js

const { MailingClient } = require('bima-shark-sdk')

const client = new MailingClient('https://mailing-development.bundesimmo.de', {
  serviceToken: {
    baseUrl: 'https://doorkeeper-development.bundesimmo.de',
    accessKey: 'your-access-key',
    secretKey: 'your-secret-key',
    userId: '1234567890'  // optional
  }
})

try {
  const json = await client.create({ foo: 'bar' })
  console.log('Success: ', json)
} catch (err) {
  console.log('Error: ', err)
}

Additionally, you can use your own function to generate authentication tokens:

const { MailingClient } = require('bima-shark-sdk')

const client = new MailingClient('https://mailing-development.bundesimmo.de', {
  getAuthToken: () => 'Bearer ' + crypto.randomBytes(20).toString('hex')
})

or generate JWT-based short-lived tokens which are valid for 1 minute:

const { MailingClient, jwtAuthorization } = require('bima-shark-sdk')

const client = new MailingClient('https://mailing-development.bundesimmo.de', {
  getAuthToken: () => {
    const accessId = 'mailingservice'
    const secretKey = 'ZT...=='

    return jwtAuthorization({ accessId, secretKey })
  }
})

Testing

This SDK uses jest as test framework. Server responses are mocked with nock.

npm ci
npm test

FAQs

Package last updated on 26 Aug 2025

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