npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@signitsa/signitsa-embedded

v1.0.3

Published

Embed Signit signature requests from within your web application.

Downloads

68

Readme

Signit Embedded

Embed Signit signature requests and templates from within your web application.

Npm version Npm downloads Npm minified

Usage

The instructions below are for Signit Embedded.

Start by installing the Signit Embedded library from npm.

  • Via npm:
npm install @signitsa/signitsa-embedded
  • Via yarn:
yarn add @signitsa/signitsa-embedded
  • Via pnpm:
pnpm add @signitsa/signitsa-embedded
  • using jsDelivr:

If you prefer to load the library via CDN, you can use jsDelivr.

<script src="https://cdn.jsdelivr.net/npm/@signitsa/signitsa-embedded"></script>
  • using unpkg:

Alternatively, you can also load the library from unpkg:

<script src="https://unpkg.com/@signitsa/signitsa-embedded"></script>

In app usage

In your frontend app, import @signitsa/signitsa-embedded and instantiate a new client with your API app's client ID.

import SignitEmbedded from '@signitsa/signitsa-embedded';

// Create the Signit Embedded instance.
// Only do this once!
const client = new SignitEmbedded({
  clientId: 'Your client ID',
  debug: true,
  locale: SignitEmbedded.locales.EN_US,
  // Add other configuration options as needed
});

When you're ready to launch Signit Embedded, simply call open() on the client with your signature request's signing URL.

function launchSignitEmbedded(url) {
  client.open(url, options);
}

launchSignitEmbedded(url);

Usage with CDN

After including the library via CDN (jsDelivr or unpkg), you can use SignitEmbedded directly in your JavaScript. Here's a breakdown of how to set it up if you are using the package with a CDN.

Step 1: Add the CDN Script Tag

Add the SignitEmbedded script from jsDelivr or unpkg in your HTML file, ideally at the end of the <body> tag to ensure it loads after the rest of your HTML:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>SignitEmbedded Example</title>
  </head>
  <body>
    <!-- SignitEmbedded library (from jsDelivr or unpkg) -->
    <script src="https://cdn.jsdelivr.net/npm/@signitsa/signitsa-embedded"></script>
    <!-- OR use unpkg if preferred -->
    <!-- <script src="https://unpkg.com/@signitsa/signitsa-embedded"></script> -->

    <!-- Initialize SignitEmbedded -->
    <script>
      // Step 2: Initialize SignitEmbedded after the script loads
      document.addEventListener('DOMContentLoaded', function () {
        // Access SignitEmbedded from the global window object
        const client = new window.SignitEmbedded.default({
          clientId: YOUR_CLIENT_ID,
          allowCancel: true,
          debug: false,
          hideHeader: false,
          timeout: 999999,
          // Add other configuration options as needed
        });
        client.open(EMBEDDED_URL, {
          whiteLabeling: {
            theme: {
              lightPrimary: 'green',
              darkPrimary: 'blue',
            },
          },
          // Add other configuration options as needed
        });
      });
    </script>
  </body>
</html>

Explanation

  1. Script Tag Inclusion: The <script src="..."> tag loads the SignitEmbedded library from the specified CDN (either jsDelivr or unpkg). This makes the library accessible globally through the window object.

  2. DOMContentLoaded Event: The DOMContentLoaded event listener ensures that the script initializes only after the HTML content has fully loaded. This prevents issues where the library might attempt to access elements that haven't rendered yet.

  3. Accessing SignitEmbedded: When loading from a CDN, SignitEmbedded is available on the window object (e.g., window.SignitEmbedded). You can use this to create a new instance and configure it with options like clientId.

For more information on how to use Signit Embedded, visit the API Documentation.

Support

If you have any questions or issues with Signit Embedded or our API, please contact [email protected].

Resources

© 2024 Signit. All rights reserved.