1.1.2 • Published 4 months ago

@linktoqr/l2qr-sdk v1.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

L2QR SDK for JavaScript

CI

Installation

npm install @linktoqr/l2qr-sdk

REST API

You can also use our REST API Docs

Usage

Initialize the SDK with the L2qr project API token. You can generate one here: L2QR app -> settings -< api

⚠️ Don't forget to set "Website restrictions".

ES5

import L2qr from '@linktoqr/l2qr-sdk';

const l2qr = new L2qr('${API_KEY}');

CJS

const L2qr = require('@linktoqr/l2qr-sdk').default;

const l2qr = new L2qr('${API_KEY}');

Make a request. You will have to await all requests.

const options = {...}
const staticQrCode = await l2qr.staticQrCodes.create(options);

Methods

I will be adding new methods. Please open issues of the methods you need and I'll add them.

Static QR codes

options

// Create a static qr code
const options = {...}
const newStaticQrCode = await l2qr.staticQrCodes.create(options);
// newStaticQrCode: { url: "${STATIC_QR_CODE_URL}", ... }

Static QR codes file

options

// Get a static qr code file
const options = {
  format: '', // suppered formats 
  ...
}
const staticQrCodeFile = await l2qr.staticQrCodesFile.get(options);
// staticQrCodeFile: File (with defined format)

Using with Nuxt js

// nuxt.config.js
export default {
  // ...
  build: {
    transpile: ['@linktoqr/l2qr-sdk'],
  },
}

Some options

OptionTypeDefaultValue
FormatStringSvgpng, svg, webp, jpeg, gif, avif
1.1.1

4 months ago

1.1.0

4 months ago

1.1.2

4 months ago

1.0.2

5 months ago

1.0.3

5 months ago

1.0.1

5 months ago