{"_id":"@devcycle/devcycle-nodejs-sdk","_rev":"10-778a026f2cecd487d6cc86f841a7502e","name":"@devcycle/devcycle-nodejs-sdk","dist-tags":{"latest":"0.0.0-alpha-3"},"versions":{"0.0.0":{"name":"@devcycle/devcycle-nodejs-sdk","version":"0.0.0","keywords":[],"author":{},"license":"MIT","_id":"@devcycle/devcycle-nodejs-sdk@0.0.0","maintainers":[{"name":"elottap","email":"elliot@taplytics.com"},{"name":"jstapl","email":"jsalaber@taplytics.com"},{"name":"rohit-tap","email":"rohit@taplytics.com"},{"name":"taplyticsuser","email":"phong@taplytics.com"}],"dist":{"shasum":"c2ba0ce2a90e2d8c5213dcde897df26e4dd59084","tarball":"https://registry.npmjs.org/@devcycle/devcycle-nodejs-sdk/-/devcycle-nodejs-sdk-0.0.0.tgz","fileCount":24,"integrity":"sha512-49OIzFYpblcYWzrYGwzTeIAvfuXnHST2gb0IFCuJonX1d/wagLs1l9ljWguNbN4OZcTRt2gGJN2BIS42kZFcdw==","signatures":[{"sig":"MEQCIFHHcpBgGvIAqmErix8bJ7bQDeDfTjSZjB73ta0vCE7TAiBIOX1XiM+GbNJX4u13xVbPYxiEBxjcieio5+GSngC9gg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":433137},"main":"dist/app.min.js","types":"src/api.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"webpack","build:dev":"webpack --env dev","prepublish":"tsc"},"_npmUser":{"name":"elottap","email":"elliot@taplytics.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","description":"The Node SDK for DevCycle!","directories":{},"dependencies":{"node-fetch":"2.6.1"},"_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.61.0","ts-loader":"^5.4.5","@babel/cli":"^7.15.7","typescript":"^4.4.4","@babel/core":"^7.15.8","@types/jest":"^27.0.2","webpack-cli":"^4.9.1","@babel/preset-env":"^7.15.8","webpack-node-externals":"^3.0.0","@babel/preset-typescript":"^7.15.0"},"_npmOperationalInternal":{"tmp":"tmp/devcycle-nodejs-sdk_0.0.0_1635969496593_0.04365989776726065","host":"s3://npm-registry-packages"}},"0.0.0-alpha-2":{"name":"@devcycle/devcycle-nodejs-sdk","version":"0.0.0-alpha-2","keywords":[],"author":"","license":"MIT","_id":"@devcycle/devcycle-nodejs-sdk@0.0.0-alpha-2","maintainers":[{"name":"elottap","email":"elliot@taplytics.com"},{"name":"jstapl","email":"jsalaber@taplytics.com"},{"name":"rohit-tap","email":"rohit@taplytics.com"},{"name":"taplyticsuser","email":"phong@taplytics.com"}],"dist":{"shasum":"97350b0ed637063e2c41fe176e1f836efba65ad5","tarball":"https://registry.npmjs.org/@devcycle/devcycle-nodejs-sdk/-/devcycle-nodejs-sdk-0.0.0-alpha-2.tgz","fileCount":18,"integrity":"sha512-YGZDKKNNSdwdzpdmwm1zmPX6mLIIzSYXAMu44Erfkfy+uLOHfiWZW51G0izItadnUC5Wa23J3CYzMMtZZXPVZg==","signatures":[{"sig":"MEQCIG73DvXPMIG6nVf0n2BNb4v2FyhDbv/mKSqbMRUosaQjAiBKImRxwrMqX6cWHmROFGOCbctN1ZAV54pO16F6tia2dw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97801},"main":"dist/app.min.js","types":"src/api.d.ts","gitHead":"764b17b940087ba846b4c6cfd7b6711c96871cf4","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"webpack","build:dev":"webpack --env dev","prepublish":"tsc --declaration --emitDeclarationOnly"},"_npmUser":{"name":"elottap","email":"elliot@taplytics.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","_npmVersion":"8.1.0","description":"The Node SDK for DevCycle!","directories":{},"_nodeVersion":"16.13.0","dependencies":{"tsc":"^2.0.3","node-fetch":"2.6.1"},"_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.61.0","ts-loader":"^5.4.5","@babel/cli":"^7.15.7","typescript":"^4.4.4","@babel/core":"^7.15.8","@types/jest":"^27.0.2","webpack-cli":"^4.9.1","babel-loader":"^8.2.3","@babel/preset-env":"^7.15.8","webpack-node-externals":"^3.0.0","@babel/preset-typescript":"^7.15.0"},"_npmOperationalInternal":{"tmp":"tmp/devcycle-nodejs-sdk_0.0.0-alpha-2_1636123400272_0.25635993634086174","host":"s3://npm-registry-packages"}},"0.0.0-alpha-3":{"name":"@devcycle/devcycle-nodejs-sdk","version":"0.0.0-alpha-3","keywords":[],"author":"","license":"MIT","_id":"@devcycle/devcycle-nodejs-sdk@0.0.0-alpha-3","maintainers":[{"name":"elottap","email":"elliot@taplytics.com"},{"name":"jstapl","email":"jsalaber@taplytics.com"},{"name":"rohit-tap","email":"rohit@taplytics.com"},{"name":"taplyticsuser","email":"phong@taplytics.com"}],"dist":{"shasum":"1866ba05e3b8b7e7a6b735688cdef91e2dd06b29","tarball":"https://registry.npmjs.org/@devcycle/devcycle-nodejs-sdk/-/devcycle-nodejs-sdk-0.0.0-alpha-3.tgz","fileCount":19,"integrity":"sha512-SHxWpIR7UtN2iXBsCzdrUy7f7GDXy8PbHmtZjFmn2qtUHTEyJYDAoJ4FRB6tI9bRbFbDPk5ZUCY2EiGk0nedCA==","signatures":[{"sig":"MEQCIBrJHw0FI7167OfVUJ83ZvIithqi9tzwkWCcEgm6mZ4JAiAVjvyZGyulzCZaIdkvAZRiQS11y4eJxvx/WsgbqrzbCw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhksf5CRA9TVsSAnZWagAAOPIP/jbP63RR2q6+wMpCz35E\noOroB8QW6x90ovpF+D31UkTgK2tOWV0Iu6dNojU99/LWPRpxv9urTkKK8oVN\n6QTojYGq9/NHqpXpGQNAx2A0mrMwCJ+LqKGvwop+kkRyFJHYLh4HKyEUurRI\naealhGB7wey2qdnDGg9JME2oNRVDFQbYLWWsoqbg0etokt1uZlwXwZwrqNTE\nyhww+8HCXVa6MBtgfhDNf9G/86D6/slr/u0pZrRDLN3czbWLh1KGRQXTFSvC\naH0NWuBG5xbBKQNdDZ7EklIqo/rRu3cXG2OQ/jmJ9JevE8WwK29FfHMpDSV/\n6gt8ubAqIoKAF5Ak2VDdgzr4rCRkckrPjRjyGcpodJ4ViE/vjUWC+hD/qKj0\nipsNyEoKxsBn81C11j8i6Qtldq6Sd+JvmvQA3ioW0eoLU3VfEtRI1DJ/URoJ\nt4Dykp2KTuIJ8qwnmwhTjFQzDN2QjhN/lD/fFkiZKYNeAmJED7M48OQ7qP/r\nHq/NpR9Yr7+O8RMRWWFitAGz87uTbvVIonecms3dhxbwCeBcdguuda+duxzk\nb2JF+Rr4NRUS2CV6CMu6UF+MyDQy+JeIx7XirN5qBhYRG5mXL+oC+QoX6KgG\nMtS2mGaMJ8JrNajyjxEA9H4y8/nKvayGcC5HCl6QYthmgXCOLOhGQEGsB2wP\n169K\r\n=AuAv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/app.min.js","types":"src/index.d.ts","gitHead":"ae0435c334d77f44a5a89bdec1946cfc3505e030","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"webpack","build:dev":"webpack --env dev","prepublish":"tsc --declaration --emitDeclarationOnly"},"_npmUser":{"name":"elottap","email":"elliot@taplytics.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","_npmVersion":"8.1.0","description":"The Node SDK for DevCycle!","directories":{},"_nodeVersion":"16.13.0","dependencies":{"tsc":"^2.0.3","node-fetch":"2.6.1"},"_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.61.0","ts-loader":"^5.4.5","@babel/cli":"^7.15.7","typescript":"^4.4.4","@babel/core":"^7.15.8","@types/jest":"^27.0.2","webpack-cli":"^4.9.1","babel-loader":"^8.2.3","@babel/preset-env":"^7.15.8","webpack-node-externals":"^3.0.0","@babel/preset-typescript":"^7.15.0"},"_npmOperationalInternal":{"tmp":"tmp/devcycle-nodejs-sdk_0.0.0-alpha-3_1637009401179_0.7981502288812248","host":"s3://npm-registry-packages"}}},"time":{"created":"2021-11-03T19:58:16.539Z","modified":"2025-10-15T13:28:39.001Z","0.0.0":"2021-11-03T19:58:16.807Z","0.0.0-alpha-2":"2021-11-05T14:43:20.437Z","0.0.0-alpha-3":"2021-11-15T20:50:01.595Z"},"license":"MIT","keywords":[],"description":"The Node SDK for DevCycle!","maintainers":[{"email":"jonathannorris@gmail.com","name":"jonathannorris"},{"email":"support@devcycle.com","name":"devcycleuser"}],"readme":"# DevCycle NodeJS SDK\n\nThe NodeJS SDK for DevCycle!\n\n# Installation\n\nOur library can be found on npm and installed by the following:\n\n```\nnpm install @devcycle/devcycle-nodejs-sdk\n```\n\nTo use in your project, import the `initialize` function:\n\n# Usage\n\n```\nimport { DVC, Configuration }  from '@devcycle/devcycle-nodejs-sdk'\n```\n\n```\nconst config = new Configuration({\n    apiKey: 'your_server_key_here'\n})\n\nconst instance: DVC = new DVC(config)\n```\n## User Object\n\nThe full user data must be passed into every request. The only required field is the `user_id`. The rest are optional and may affect the variables and features that are returned from the calls below.\n```\nconst user = {\n    user_id: 'user1',\n    name: 'user 1 name',\n    customData: {\n        customKey: 'customValue'\n    }\n}\n```\n\n## Getting All Features\n\nYou can wait on the features to be loaded from our servers by using `getFeatures()` function. It returns a promise that you can use to wait until features are ready to be used:\n\n```\n    const features = await instance.getFeatures(user)\n\n```\n\n## Grabbing Variable Values\n\nTo get values from your Variables, `getVariable()` is used to fetch variable values using the identifier `key` coupled with a default value. The default value can be of type string, boolean, number, or object.\n\n```\nconst variable = instance.getVariableByKey(user, 'YOUR_VARIABLE_KEY', 'default value')\n```\n\nTo grab the value, there is a property on the object returned to grab the value\n\n```\nconst variable = {\n    _id,\n    value,\n    key,\n    type\n}\n```\n\nThe variable also contains the variable `_id`, `key`, and `type`. \nIn a situation where the default value is needed (e.g. the user in the request is not part of a feature that controls the variable), then the default value is used. \nIn that case, the variable returned from the function will not contain the `_id` or `type` fields.\n\n## Grabbing All Variables\n\nTo grab all the Variables for a user:\n\n```\n   const variables = await instance.getVariables(user)\n```\n","readmeFilename":"README.md"}