hellosign-embedded
Advanced tools
Comparing version 1.5.1 to 2.0.0-0
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./umd/embedded.production.min.js'); | ||
module.exports = require('./umd/embedded.production.min.js'); // eslint-disable-line global-require | ||
} else { | ||
module.exports = require('./umd/embedded.development.js'); | ||
module.exports = require('./umd/embedded.development.js'); // eslint-disable-line global-require | ||
} |
{ | ||
"name": "hellosign-embedded", | ||
"version": "1.5.1", | ||
"version": "2.0.0-0", | ||
"description": "Embed HelloSign signature requests and templates from within your web application.", | ||
"homepage": "https://github.com/HelloFax/hellosign-embedded", | ||
"main": "index.js", | ||
"license": "ISC", | ||
"scripts": { | ||
"build": "webpack", | ||
"demo": "npm run build && npm start --prefix=demo", | ||
"prerelease": "node scripts/pre-release.js", | ||
"setup": "npm install && npm run build && npm run setup --prefix=demo", | ||
"test": "mocha test" | ||
"test": "jest src" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/HelloFax/hellosign-embedded.git" | ||
"url": "git+https://github.com/hellosign/hellosign-embedded.git" | ||
}, | ||
"author": { | ||
"name": "HelloSign", | ||
"email": "api@hellosign.com", | ||
"url": "https://hellosign.com" | ||
"keywords": [ | ||
"hellosign", | ||
"embedded", | ||
"esignature", | ||
"esign", | ||
"sign" | ||
], | ||
"author": "HelloSign <apisupport@hellosign.com> (http://api.hellosign.com)", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/hellosign/hellosign-embedded/issues" | ||
}, | ||
"homepage": "https://github.com/hellosign/hellosign-embedded#readme", | ||
"dependencies": { | ||
"common-tags": "^1.8.0", | ||
"debug": "^3.1.0", | ||
"tiny-emitter": "^2.0.2" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.0.0-beta.42", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.42", | ||
"@babel/plugin-transform-object-assign": "^7.0.0-beta.42", | ||
"@babel/preset-env": "^7.0.0-beta.42", | ||
"babel-loader": "^8.0.0-beta.2", | ||
"chai": "^4.1.2", | ||
"jsdom": "^11.6.2", | ||
"jsdom-global": "^3.0.2", | ||
"mocha": "^5.0.4", | ||
"webpack": "^4.2.0", | ||
"webpack-cli": "^2.0.13" | ||
}, | ||
"files": [ | ||
"umd", | ||
"index.js" | ||
] | ||
"@babel/core": "^7.0.0-beta.53", | ||
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.53", | ||
"@babel/plugin-proposal-export-default-from": "^7.0.0-rc.0", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.53", | ||
"@babel/plugin-transform-object-assign": "^7.0.0-beta.53", | ||
"@babel/preset-env": "^7.0.0-beta.53", | ||
"@hellosign/eslint-config": "^1.0.0", | ||
"babel-core": "^7.0.0-bridge.0", | ||
"babel-eslint": "^8.2.6", | ||
"babel-jest": "^23.4.0", | ||
"babel-loader": "^8.0.0-beta.4", | ||
"css-loader": "^1.0.0", | ||
"eslint": "^5.3.0", | ||
"jest": "^23.4.0", | ||
"jest-runner-eslint": "^0.6.0", | ||
"node-sass": "^4.9.3", | ||
"sass-loader": "^7.1.0", | ||
"style-loader": "^0.22.1", | ||
"webpack": "^4.16.0", | ||
"webpack-cli": "^3.1.0" | ||
} | ||
} |
241
README.md
@@ -1,31 +0,16 @@ | ||
# hellosign-embedded [![Build Status](https://travis-ci.org/HelloFax/hellosign-embedded.svg?branch=master)](https://travis-ci.org/HelloFax/hellosign-embedded) | ||
# Hellosign Embedded | ||
**Welcome!** | ||
> Embed [HelloSign][external_hellosign] signature requests and templates from within your web application. | ||
HelloSign Embedded allows you to embed HelloSign signature requests and templates from within your web application. | ||
[![Npm version][badge_npm-version]][external_npm] | ||
[![Npm downloads][badge_npm-downloads]][external_npm] | ||
[![Travis][badge_travis]][external_travis] | ||
[![David][badge_david]][external_david] | ||
For more information, review our [API documentation](https://www.hellosign.com/api/documentation). | ||
<br/> | ||
**Contents** | ||
🎉 **HelloSign Embedded v2** is now available! Please check the [migration guide][wiki_migration-guide] if you need help upgrading from v1 to v2. | ||
* [Installation](#installation) | ||
* [Usage](#usage) | ||
* [Documentation](#documentation) | ||
* [`init()`](#init) | ||
* [`open()`](#open) | ||
* [`close()`](#close) | ||
* [Demo](#demo) | ||
* [Other](#other) | ||
* [TypeScript](#typescript) | ||
## Install | ||
*** | ||
## Installation | ||
## Installation | ||
**npm** | ||
``` | ||
@@ -35,195 +20,53 @@ $ npm install hellosign-embedded | ||
**CDN links** | ||
HelloSign is also available over a CDN. | ||
## Demo | ||
```html | ||
<script crossorigin src="https://unpkg.com/hellosign-embedded@1/umd/embedded.development.js"></script> | ||
``` | ||
```js | ||
import HelloSign from 'hellosign-embedded'; | ||
The version above is only meant for development, and is not suitable for production. A minified and optimized production version of HelloSign Embedded is available at: | ||
const client = new HelloSign(); | ||
```html | ||
<script crossorigin src="https://unpkg.com/hellosign-embedded@1/umd/embedded.production.min.js"></script> | ||
client.open(signUrl, { | ||
clientId: 'Your API client ID' | ||
}); | ||
``` | ||
To load a specific version of `hellosign-embedded`, replace `1` with the version number, tag, or semver range. More information about how to use unpkg can be found [here](https://unpkg.com/). | ||
## Resources | ||
## Usage | ||
* [Quickstart][wiki_quickstart] | ||
* [API Documentation][wiki_api-documentation] | ||
* [Walkthroughs][external_walkthroughs] | ||
* [Changelog][wiki_changelog] | ||
* [Demo][external_demo] | ||
1. First you'll need an API key and Client ID. If you haven't done so yet, head on over to the [API settings for your account](https://www.hellosign.com/home/myAccount#api) on HelloSign and create an API App. | ||
<br/> | ||
<br/> | ||
<hr/> | ||
2. Import the library into your frontend app. The below example is using ES6 module imports. | ||
© 2018 [HelloSign][external_hellosign]. All rights reserved. | ||
```js | ||
import hellosign from 'hellosign-embedded'; | ||
``` | ||
If you have installed the library from our global CDN, it will be available at `window.HelloSign`. | ||
```js | ||
const hellosign = window.HelloSign; | ||
``` | ||
3. Initialize the HelloSign Embedded client with your API app's client ID. | ||
```js | ||
const CLIENT_ID = '0123456789abcdef0123456789abcdef'; | ||
hellosign.init(CLIENT_ID); | ||
``` | ||
[license]: ./LICENSE.md | ||
4. Use your [HelloSign SDK of choice](https://app.hellosign.com/api/libraries#Official) to create an embedded signature request and get the signing URL. An example of how this is done using the NodeJS API can be found in the demo in this repository. | ||
[badge_npm-version]: https://img.shields.io/npm/v/hellosign-embedded.svg | ||
[badge_npm-downloads]: https://img.shields.io/npm/dm/hellosign-embedded.svg | ||
[badge_david]: https://img.shields.io/david/hellosign/hellosign-embedded.svg | ||
[badge_travis]: https://img.shields.io/travis/hellosign/hellosign-embedded/master.svg | ||
5. Then, open the signature request. | ||
[wiki_home]: https://github.com/hellosign/hellosign-embedded/wiki | ||
[wiki_api-documentation]: https://github.com/hellosign/hellosign-embedded/wiki/API-Documentation-%28v2%29 | ||
[wiki_changelog]: https://github.com/hellosign/hellosign-embedded/wiki/Changelog | ||
[wiki_migration-guide]: https://github.com/hellosign/hellosign-embedded/wiki/Migration-Guide-(v1-to-v2) | ||
[wiki_quickstart]: https://github.com/hellosign/hellosign-embedded/wiki/Quickstart | ||
```js | ||
hellosign.open({ | ||
url: signUrlFromSdk, | ||
allowCancel: true, | ||
debug: true, | ||
skipDomainVerification: true, | ||
uxVersion: 2 | ||
}); | ||
``` | ||
A list of available options can be found in the documentation for the `open()` method [below](#open). | ||
More information and examples can be found in the [Embedded Signing Walkthrough](https://app.hellosign.com/api/embeddedSigningWalkthrough) in the official HelloSign API docs. | ||
## API | ||
### init() | ||
**`hellosign.init(clientId)`** | ||
Initializes the HellSign embedded library with the given client id. | ||
**Parameters** | ||
* **clientId** *String* | ||
Your API app's unique client id. | ||
### open() | ||
**`hellosign.open(options)`** | ||
Opens an embedded signature request in an iFrame with the given options. | ||
**Parameters** | ||
* **`options`** *Object* | ||
Options to send to the `hellosign.open()` method. | ||
* `url` *String* (required) | ||
The signature request URL to open in the embedded iFrame. | ||
* `uxVersion` *Number* (required) | ||
An integer representing the version of the embedded signing UX to display to users, where `1` is the legacy UX and `2` is the responsive UX. It is currently required that you specify `uxVersion: 2`. This option is in the process of being phased out, but is required in the interim. | ||
* `requester` *String* (required*) | ||
The email of the individual issuing the signature request. This option is **required** only for "Me and Others" signature requests. | ||
* `redirectUrl` *String* | ||
A URL pointing to where to redirect to after the embedded signature request has been completed by the user. | ||
* `allowCancel` *Boolean* | ||
A boolean indicating whether or not a "Cancel" button is displayed to the user. Defaults to `true`. | ||
* `messageListener` *Function* | ||
A function which is called when window messages are received from the embedded iFrame. See [`window.postMessage()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage). The callback passes the following as arguments: | ||
* `message` *Object* | ||
* `message.event` *String* - The event that was sent from the embedded iFrame. A list of possible message events can be found [here](https://app.hellosign.com/api/embeddedSigningWalkthrough#EmbeddedSigningNotes). | ||
* `userCulture` *String* | ||
The code for the language/culture to use in the embedded request. Use `hellosign.CULTURES.supportedCultures` to view a list of supported culture codes. | ||
* `debug` *Boolean* | ||
Enable debugging statement in the console. Defaults to `false`. | ||
* `skipDomainVerification` *Boolean* | ||
Skip domain verification if and only if the signature request was created with `test_mode=1`. Defaults to `false`. | ||
* `container` *HTMLElement* | ||
An HTML element in the DOM which the embedded signature request iFrame will be appended to. Defaults to `document.body`. | ||
* `height` *Number* | ||
The height of the embedded signature request iFrame in pixels, when a specific container is specified. Minimum height allowed is `480`. Defaults to `900`. | ||
* `healthCheckTimeoutMs` *Number* | ||
An integer representing the number of milliseconds to wait for a response from the embedded signature request iFrame. If there is no response in that time, the iFrame will be closed automatically. `15000` is a recommended timeout. If this option is not specified, the embedded signature request will not close if idle. | ||
* `hideHeader` *Boolean* | ||
A boolean indicating whether or not to hide the signature request header. Only customers with embedded branding enabled are able to use this option. Defaults to `false`. | ||
* `whiteLabelingOptions` *Object* | ||
An object used to customize the signer experience for premium users with white-labeling capabilities. | ||
### close() | ||
**`hellosign.close()`** | ||
Closes the embedded signature request. | ||
## Demo | ||
There is a demo app available in this repository which is useful for examining how a simple HelloSign Embedded integration can work. To get it up and running, perform the following: | ||
1. Clone this repo. | ||
``` | ||
$ git clone git@github.com:HelloFax/hellosign-embedded.git | ||
``` | ||
2. Run the setup script. | ||
``` | ||
$ npm run setup | ||
``` | ||
3. Start the demo. | ||
``` | ||
$ npm run demo | ||
``` | ||
4. If all has gone well, you should now be able to access the demo at [http://localhost:3000](http://localhost:3000). | ||
In order to test out the demo, you'll need an API Key and Client ID for HelloSign's API. If you haven't done so yet, head on over to the [API settings for your account](https://www.hellosign.com/home/myAccount#api) on HelloSign and create an API App. | ||
## Other | ||
### TypeScript | ||
TypeScript bindings for HelloSign Embedded are available in the [DefinitelyTyped repo](https://github.com/DefinitelyTyped/DefinitelyTyped). | ||
<br/> | ||
<br/> | ||
<hr/> | ||
<small>Copyright © 2018 [HelloSign](https://hellosign.com/). All rights reserved. [Contact us](mailto:api@hellosign.com).</small> | ||
[external_david]: https://david-dm.org/hellosign/hellosign-embedded | ||
[external_demo]: https://github.com/hellosign/hellosign-embedded-demo | ||
[external_hellosign]: https://hellosign.com | ||
[external_npm]: https://npmjs.org/package/hellosign-embedded | ||
[external_travis]: https://travis-ci.org/hellosign/hellosign-embedded.svg?branch=master | ||
[external_walkthroughs]: https://app.hellosign.com/api/embeddedSigningWalkthrough |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
17
1272
0
45540
3
20
1
72
1
+ Addedcommon-tags@^1.8.0
+ Addeddebug@^3.1.0
+ Addedtiny-emitter@^2.0.2
+ Addedcommon-tags@1.8.2(transitive)
+ Addeddebug@3.2.7(transitive)
+ Addedms@2.1.3(transitive)
+ Addedtiny-emitter@2.1.0(transitive)