@amna1408/sdk-js
v1.5.0
Published
Usermaven JavaScript SDK.
Readme
Usermaven JavaScript SDK (usermaven.js)
Usermaven.js is a JavaScript SDK for Usermaven.
Capabilities
- Autocapturing via
autocapture,capture_pageview,properties_string_max_lengthandproperty_blacklistoptions.
Maintainers Guide
This section is indented only for package maintainers.
Building and local debug
- ATTENTION: Use
yarnfor everything except publishing - To spin off a local development server run
yarn devserver, then open http://localhost:8081- The server listens to all changes to src and rebuilds npm and
lib.jsautomatically. Open test cases HTML files to see usermaven in action- http://localhost:8081/test-case/embed.html - embedded Usermaven
- http://localhost:8081/test-case/embed_strict_mode.html - embedded strict mode for Usermaven
- http://localhost:8081/test-case/autocapture.html - embedded Usermaven with autocapturing events
- The server listens to all changes to src and rebuilds npm and
yarn testruns Playwright testyarn buildbuilds both npm package andlib.jsbrowser bundlenpm publish --publicto publish the package (change version inpackage.jsonmanually). You need to runnpm loginwith your personal npmjs account beforehand (make sure you have access to Usermaven team)- In order to check usermaven sdk locally.
cd dist/npm--- navigate to npm directorynpm link--- creates a symbolic link to be accessed globallycd ../../__tests__/sdk/--- navigate to sdk test projectnpm i--- install npm dependenciesnpm link @usermaven/sdk-js--- use npm package locally whose symlink is just publishednpm start--- start the application and monitor events
Checking Cross Domain Session locally
Setup a custom domain and sub-domain locally to test cross domain session persistence.
sudo nano /etc/hostsAdd the following lines in the hosts file
127.0.0.1 localhost.com
127.0.0.1 app.localhost.comYou will be able to access the domains at localhost domain and localhost sub-domain
Publishing new version
- Login with your personal credentials with
npm login - Run
yarn install && yarn build && yarn test && npm publish --access public
