{"id":19188217,"url":"https://github.com/mathdroid/now-universal-client","last_synced_at":"2025-05-08T02:45:55.529Z","repository":{"id":67669625,"uuid":"91311386","full_name":"mathdroid/now-universal-client","owner":"mathdroid","description":"🎁 Universal API wrapper for now.sh","archived":false,"fork":false,"pushed_at":"2017-08-10T08:26:39.000Z","size":39,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T06:34:53.077Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathdroid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-15T08:07:35.000Z","updated_at":"2018-12-31T14:00:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c47bd9d-0c9b-4fda-83ec-3c85da5fec25","html_url":"https://github.com/mathdroid/now-universal-client","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"635648227e9b1b2f6f07a4dea8fedf0e95f183e8"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathdroid%2Fnow-universal-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathdroid%2Fnow-universal-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathdroid%2Fnow-universal-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathdroid%2Fnow-universal-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathdroid","download_url":"https://codeload.github.com/mathdroid/now-universal-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252989941,"owners_count":21836665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T11:24:03.530Z","updated_at":"2025-05-08T02:45:55.522Z","avatar_url":"https://github.com/mathdroid.png","language":"JavaScript","readme":"# now-universal-client\n\n\u003e 🎁 Promise-based Universal API wrapper for now.sh\n\n## Usage\n\n```sh\n$ npm install --save now-universal-client\n```\n\n```js\nconst {getDeployments} = require('now-universal-client')\nconst TOKEN = 'YOUR TOKEN'\n\nlet deployments\n\ntry {\n  deployments = await getDeployments({token: TOKEN})\n} catch (err) {\n  console.error(err)\n}\n\nconsole.log(deployments)\n```\n\n## API\n\n```js\nconst now = require('now-universal-client')\n```\n\n### now.getDeployments({token}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nReturns an array with all deployments.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e  \n**See**: https://zeit.co/api#list-endpoint  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n\nResolves to an array of deployments.\n\n\u003ca name=\"Now+getDeployment\"\u003e\u003c/a\u003e\n\n### now.getDeployment({token, id}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nReturns an object with deployment data.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e  \n**See**: https://zeit.co/api#get-endpoint  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| id | \u003ccode\u003eString\u003c/code\u003e | ID of deployment |\n\nResolves to the deployment object.\n\n\u003ca name=\"Now+createDeployment\"\u003e\u003c/a\u003e\n\n### now.createDeployment({token, data}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nCreates a new deployment and returns its data.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e  \n**See**: https://zeit.co/api#instant-endpoint  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| data | \u003ccode\u003eObject\u003c/code\u003e | The keys should represent a file path, with their respective values containing the file contents. |\n\nResolves to the deployment object.\n\n\u003ca name=\"Now+deleteDeployment\"\u003e\u003c/a\u003e\n\n### now.deleteDeployment({token, id}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nDeletes a deployment and returns its data.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e  \n**See**: https://zeit.co/api#rm-endpoint  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| id | \u003ccode\u003eString\u003c/code\u003e | ID of deployment |\n\nResolves to the deployment object.\n\n\u003ca name=\"Now+getFiles\"\u003e\u003c/a\u003e\n\n### now.getFiles({token, id}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nReturns an array with the file structure.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e  \n**See**: https://zeit.co/api#file-structure-endpoint  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| id | \u003ccode\u003eString\u003c/code\u003e | ID of deployment |\n\nResolves to an array with the file structure.\n\n\u003ca name=\"Now+getFile\"\u003e\u003c/a\u003e\n\n### now.getFile({token, id, fileId}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nReturns the content of a file either as string or object, depending on the filetype.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e  \n**See**: https://zeit.co/api#file--endpoint  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| id | \u003ccode\u003eString\u003c/code\u003e | ID of deployment |\n| fileId | \u003ccode\u003eString\u003c/code\u003e | ID of the file |\n\nResolves to either a String or an Object of the file's content.\n\n\u003ca name=\"Now+getDomains\"\u003e\u003c/a\u003e\n\n## now.getDomains({token}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nReturns an array with all domain names and related aliases.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e\n**See**: https://zeit.co/api#get-domains\n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n\nResolves to an array with all domain names and related aliases.\n\n\u003ca name=\"Now+addDomain\"\u003e\u003c/a\u003e\n\n## now.addDomain({token, domain}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nAdds a new domain and returns its data.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e\n**See**: https://zeit.co/api#post.domains\n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| domain | \u003ccode\u003eobject\u003c/code\u003e | An object containing a string `name` and a boolean `isExternalDNS` |\n\nResolves to an object with the domain's data.\n\n\u003ca name=\"Now+deleteDomain\"\u003e\u003c/a\u003e\n\n## now.deleteDomain({token, name}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nDeletes a domain name.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e\n**See**: https://zeit.co/api#delete-domains\n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| name | \u003ccode\u003eString\u003c/code\u003e | Domain name |\n\n\u003ca name=\"Now+getDomainRecords\"\u003e\u003c/a\u003e\n\n## now.getDomainRecords({token, domain}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nReturns an array with all DNS records configured for a domain name.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e\n**See**: https://zeit.co/api#get-domain-records\n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| name | \u003ccode\u003eString\u003c/code\u003e | Domain name |\n\nResolves to an array with all DNS records configured for a domain name.\n\n## now.addDomainRecord({token, domain, recordData}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nAdds a new DNS record for a domain.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e\n**See**: https://zeit.co/api#post-domain-records\n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| domain | \u003ccode\u003eobject\u003c/code\u003e | An object containing a string `name` and a boolean `isExternalDNS` |\n| recordData | \u003ccode\u003eobject\u003c/code\u003e | An object containing a description of the new record according to the [documentation](https://zeit.co/api#post-domain-records). |\n\n\u003ca name=\"Now+deleteDomainRecord\"\u003e\u003c/a\u003e\n\n## now.deleteDomainRecord({token, name, recordId}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nDeletes a DNS record associated with a domain.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e\n**See**: https://zeit.co/api#delete-domain-records\n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| domain | \u003ccode\u003eString\u003c/code\u003e | Domain name |\n| recordId | \u003ccode\u003eString\u003c/code\u003e | Record ID |\n\n\u003ca name=\"Now+getCertificates\"\u003e\u003c/a\u003e\n\n## now.getCertificates({token, [cn]}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nReturns an array of all certificates.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e\n**See**: https://zeit.co/api#get-certs\n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| [cn] | \u003ccode\u003eString\u003c/code\u003e | Common Name |\n\nResolves to an array of all certificates.\n\n\u003ca name=\"Now+createCertificate\"\u003e\u003c/a\u003e\n\n## now.createCertificate({token, cn}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nCreates a new certificate for a domain registered to the user.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e\n**See**: https://zeit.co/api#post-certs\n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| cn | \u003ccode\u003eString\u003c/code\u003e | Common Name |\n\n\u003ca name=\"Now+renewCertificate\"\u003e\u003c/a\u003e\n\n## now.renewCertificate({token, cn}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nRenews an existing certificate.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e\n**See**: https://zeit.co/api#post-certs\n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| cn | \u003ccode\u003eString\u003c/code\u003e | Common Name |\n\n\u003ca name=\"Now+replaceCertificate\"\u003e\u003c/a\u003e\n\n## now.replaceCertificate({token, cn, cert, key, [ca]}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nReplace an existing certificate.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e\n**See**: https://zeit.co/api#put-certs\n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| cn | \u003ccode\u003eString\u003c/code\u003e | Common Name |\n| cert | \u003ccode\u003eString\u003c/code\u003e | X.509 certificate |\n| key | \u003ccode\u003eString\u003c/code\u003e | Private key for the certificate |\n| ca | \u003ccode\u003eString\u003c/code\u003e | CA certificate chain |\n\nResolves to an object with the new certificate details.\n\n\u003ca name=\"Now+deleteCertificate\"\u003e\u003c/a\u003e\n\n## now.deleteCertificate({token, cn}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nDeletes a certificate.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e\n**See**: https://zeit.co/api#delete-certs\n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| cn | \u003ccode\u003eString\u003c/code\u003e | Common Name |\n\n\u003ca name=\"Now+getAliases\"\u003e\u003c/a\u003e\n\n### now.getAliases({token, [id]}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nReturns an array with all aliases.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e  \n**See**: https://zeit.co/api#user-aliases  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| [id OR callback] | \u003ccode\u003eString\u003c/code\u003e \u0026#124; \u003ccode\u003efunction\u003c/code\u003e | ID of deployment or callback |\n\nResolves to an array with all aliases.\n\n\u003ca name=\"Now+createAlias\"\u003e\u003c/a\u003e\n\n### now.createAlias({token, id, alias}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nCreates an alias for the given deployment.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e  \n**See**: https://zeit.co/api#create-alias  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| id | \u003ccode\u003eString\u003c/code\u003e | ID of deployment |\n| alias | \u003ccode\u003eString\u003c/code\u003e | Hostname or custom url for the alias |\n\nResolves to an Object with the alias data\n\n\u003ca name=\"Now+deleteAlias\"\u003e\u003c/a\u003e\n\n### now.deleteAlias({token, id}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nDeletes an alias and returns a status.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e  \n**See**: https://zeit.co/api#delete-user-aliases  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| id | \u003ccode\u003eString\u003c/code\u003e | ID of alias |\n\nResolves to the status\n\n\u003ca name=\"Now+getSecrets\"\u003e\u003c/a\u003e\n\n### now.getSecrets({token, id}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nReturns an array with all secrets.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e  \n**See**: https://zeit.co/api#get-now-secrets  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| [id OR callback] | \u003ccode\u003eString\u003c/code\u003e \u0026#124; \u003ccode\u003efunction\u003c/code\u003e | ID of deployment or callback |\n\nResolves to an array with all secrets.\n\n\u003ca name=\"Now+createSecret\"\u003e\u003c/a\u003e\n\n### now.createSecret({token, name, value}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nCreates a secret and returns its ID.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e  \n**See**: https://zeit.co/api#post-now-secrets  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| name | \u003ccode\u003eString\u003c/code\u003e | name for the secret |\n| value | \u003ccode\u003eString\u003c/code\u003e | value for the secret |\n\nResolves to a secret's ID.\n\n\u003ca name=\"Now+renameSecret\"\u003e\u003c/a\u003e\n\n### now.renameSecret({token, id, name}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nChanges the name of the given secret and returns its ID and name.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e  \n**See**: https://zeit.co/api#patch-now-secrets  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| id | \u003ccode\u003eString\u003c/code\u003e | id or name of the secret |\n| name | \u003ccode\u003eString\u003c/code\u003e | new name for the secret |\n\nResolves to a secret's ID and name.\n\n\u003ca name=\"Now+deleteSecret\"\u003e\u003c/a\u003e\n\n### now.deleteSecret({token, id}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nDeletes a secret and returns its ID.\n\n**Kind**: instance method of \u003ccode\u003e[Now](#Now)\u003c/code\u003e  \n**See**: https://zeit.co/api#delete-now-secrets  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n| id | \u003ccode\u003eString\u003c/code\u003e | ID or name of the secret |\n\nResolves to a secret's status.\n\n### now.getEvents({token}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nGet the latest events happened in your team.\n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n\nResolves to an array of events.\n\n### now.getUser({token}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nGet the info of user with the provided token\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n\nResolves to a user object.\n\n### now.getTeams({token}) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nGet the teams that are related to the given token.\n\n| Param | Type | Description |\n| --- | --- | --- |\n| token | \u003ccode\u003eString\u003c/code\u003e | Your ZEIT token |\n\nResolves to an array of teams.\n\n## License\n\nSee [License](./LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathdroid%2Fnow-universal-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathdroid%2Fnow-universal-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathdroid%2Fnow-universal-client/lists"}