{"id":28645556,"url":"https://github.com/square/square-nodejs-sdk","last_synced_at":"2026-01-22T20:14:27.236Z","repository":{"id":37798196,"uuid":"184623517","full_name":"square/square-nodejs-sdk","owner":"square","description":"Typescript client library for the Square API","archived":false,"fork":false,"pushed_at":"2025-12-17T21:44:53.000Z","size":10492,"stargazers_count":104,"open_issues_count":4,"forks_count":45,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-12-18T23:39:32.655Z","etag":null,"topics":["built-with-fern","generated-from-openapi","nodejs","square","typescript"],"latest_commit_sha":null,"homepage":"https://developer.squareup.com/docs/sdks","language":"TypeScript","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/square.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-05-02T17:32:08.000Z","updated_at":"2025-12-17T21:44:57.000Z","dependencies_parsed_at":"2023-02-06T06:32:06.940Z","dependency_job_id":"b9e7e37c-d29d-4ab3-a501-94968056a721","html_url":"https://github.com/square/square-nodejs-sdk","commit_stats":null,"previous_names":[],"tags_count":70,"template":false,"template_full_name":null,"purl":"pkg:github/square/square-nodejs-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2Fsquare-nodejs-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2Fsquare-nodejs-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2Fsquare-nodejs-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2Fsquare-nodejs-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/square","download_url":"https://codeload.github.com/square/square-nodejs-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2Fsquare-nodejs-sdk/sbom","scorecard":{"id":843228,"data":{"date":"2025-08-11","repo":{"name":"github.com/square/square-nodejs-sdk","commit":"86e562a955db033a19ed82004abbbc3d4aa1451c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.2,"checks":[{"name":"Maintained","score":10,"reason":"12 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":4,"reason":"Found 3/7 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/integration.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/square/square-nodejs-sdk/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/square/square-nodejs-sdk/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/square/square-nodejs-sdk/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/square/square-nodejs-sdk/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/square/square-nodejs-sdk/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/square/square-nodejs-sdk/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/integration.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/square/square-nodejs-sdk/integration.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/integration.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/square/square-nodejs-sdk/integration.yml/master?enable=pin","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T20:55:11.874Z","repository_id":37798196,"created_at":"2025-08-23T20:55:11.874Z","updated_at":"2025-08-23T20:55:11.874Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28670366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T19:36:09.361Z","status":"ssl_error","status_checked_at":"2026-01-22T19:36:05.567Z","response_time":144,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["built-with-fern","generated-from-openapi","nodejs","square","typescript"],"created_at":"2025-06-13T01:39:00.701Z","updated_at":"2026-01-22T20:14:27.207Z","avatar_url":"https://github.com/square.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Square TypeScript Library\n\n[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github\u0026utm_medium=github\u0026utm_campaign=readme\u0026utm_source=https%3A%2F%2Fgithub.com%2Fsquare%2Fsquare-nodejs-sdk)\n[![npm shield](https://img.shields.io/npm/v/square)](https://www.npmjs.com/package/square)\n\nThe Square TypeScript library provides convenient access to the Square APIs from TypeScript.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Reference](#reference)\n- [Versioning](#versioning)\n- [Usage](#usage)\n- [Legacy Sdk](#legacy-sdk)\n- [Request and Response Types](#request-and-response-types)\n- [Exception Handling](#exception-handling)\n- [File Uploads](#file-uploads)\n- [Pagination](#pagination)\n- [Webhook Signature Verification](#webhook-signature-verification)\n- [Advanced](#advanced)\n  - [Additional Headers](#additional-headers)\n  - [Additional Query String Parameters](#additional-query-string-parameters)\n  - [Retries](#retries)\n  - [Timeouts](#timeouts)\n  - [Aborting Requests](#aborting-requests)\n  - [Access Raw Response Data](#access-raw-response-data)\n  - [Logging](#logging)\n  - [Runtime Compatibility](#runtime-compatibility)\n- [Contributing](#contributing)\n\n## Installation\n\n```sh\nnpm i -s square\n```\n\n## Reference\n\nA full reference for this library is available [here](https://github.com/square/square-nodejs-sdk/blob/HEAD/./reference.md).\n\n## Versioning\n\nBy default, the SDK is pinned to the latest version. If you would like\nto override this version you can simply pass in a request option.\n\n```ts\nawait client.payments.create(..., {\n    version: \"2024-05-04\" // override the version used\n})\n```\n\n## Usage\n\nInstantiate and use the client with the following:\n\n```typescript\nimport { SquareClient } from \"square\";\n\nconst client = new SquareClient({ token: \"YOUR_TOKEN\" });\nawait client.payments.create({\n    sourceId: \"ccof:GaJGNaZa8x4OgDJn4GB\",\n    idempotencyKey: \"7b0f3ec5-086a-4871-8f13-3c81b3875218\",\n    amountMoney: {\n        amount: BigInt(\"1000\"),\n        currency: \"USD\"\n    },\n    appFeeMoney: {\n        amount: BigInt(\"10\"),\n        currency: \"USD\"\n    },\n    autocomplete: true,\n    customerId: \"W92WH6P11H4Z77CTET0RNTGFW8\",\n    locationId: \"L88917AVBK2S5\",\n    referenceId: \"123456\",\n    note: \"Brief description\"\n});\n```\n\n## Legacy SDK\n\n\u003e If you're using TypeScript, make sure that the `moduleResolution` setting in your `tsconfig.json` is equal to `node16`, `nodenext`, \u003e or `bundler` to consume the legacy SDK.\nWhile the new SDK has a lot of improvements, we at Square understand that it takes time to upgrade when there are breaking changes. To make the migration easier, the new SDK also exports the legacy SDK as `square/legacy`. Here's an example of how you can use the legacy SDK alongside the new SDK inside a single file:\n```typescript import { randomUUID } from \"crypto\"; import { Square, SquareClient } from \"square\"; import { Client } from \"square/legacy\";\nconst client = new SquareClient({\n  token: process.env.SQUARE_ACCESS_TOKEN,\n});\nconst legacyClient = new Client({\n  bearerAuthCredentials: {\n    accessToken: process.env.SQUARE_ACCESS_TOKEN!,\n  },\n});\nasync function getLocation(): Promise\u003cSquare.Location\u003e {\n  return (\n    await client.locations.get({\n      locationId: \"YOUR_LOCATION_ID\",\n    })\n  ).location!;\n}\nasync function createOrder() {\n  const location = await getLocation();\n  await legacyClient.ordersApi.createOrder({\n    idempotencyKey: randomUUID(),\n    order: {\n      locationId: location.id!,\n      lineItems: [\n        {\n          name: \"New Item\",\n          quantity: \"1\",\n          basePriceMoney: {\n            amount: BigInt(100),\n            currency: \"USD\",\n          },\n        },\n      ],\n    },\n  });\n}\ncreateOrder(); ```\nWe recommend migrating to the new SDK using the following steps:\n1. Upgrade the NPM module to `^40.0.0` 2. Search and replace all requires and imports from `\"square\"` to `\"square/legacy\"`\n- For required, replace `require(\"square\")` with `require(\"square/legacy\")` - For imports, replace `from \"square\"` with `from \"square/legacy\"` - For dynamic imports, replace `import(\"square\")` with `import(\"square/legacy\")`\n3. Gradually move over to use the new SDK by importing it from the `\"square\"` import.\n\n\n## Request and Response Types\n\nThe SDK exports all request and response types as TypeScript interfaces. Simply import them with the\nfollowing namespace:\n\n```typescript\nimport { Square } from \"square\";\n\nconst request: Square.RevokeTokenRequest = {\n    ...\n};\n```\n\n## Exception Handling\n\nWhen the API returns a non-success status code (4xx or 5xx response), a subclass of the following error\nwill be thrown.\n\n```typescript\nimport { SquareError } from \"square\";\n\ntry {\n    await client.payments.create(...);\n} catch (err) {\n    if (err instanceof SquareError) {\n        console.log(err.statusCode);\n        console.log(err.message);\n        console.log(err.body);\n        console.log(err.rawResponse);\n    }\n}\n```\n\n## File Uploads\n\nYou can upload files using the client:\n\n```typescript\nimport { createReadStream } from \"fs\";\nimport { SquareClient } from \"square\";\n\nconst client = new SquareClient({ token: \"YOUR_TOKEN\" });\nawait client.disputes.createEvidenceFile({\n    disputeId: \"dispute_id\"\n});\n```\nThe client accepts a variety of types for file upload parameters:\n* Stream types: `fs.ReadStream`, `stream.Readable`, and `ReadableStream`\n* Buffered types: `Buffer`, `Blob`, `File`, `ArrayBuffer`, `ArrayBufferView`, and `Uint8Array`\n\n### Metadata\n\nYou can configure metadata when uploading a file:\n```typescript\nconst file: Uploadable.WithMetadata = {\n    data: createReadStream(\"path/to/file\"),\n    filename: \"my-file\",       // optional\n    contentType: \"audio/mpeg\", // optional\n    contentLength: 1949,       // optional\n};\n```\n\nAlternatively, you can upload a file directly from a file path:\n```typescript\nconst file : Uploadable.FromPath = {\n    path: \"path/to/file\",\n    filename: \"my-file\",        // optional\n    contentType: \"audio/mpeg\",  // optional\n    contentLength: 1949,        // optional\n};\n```\n\nThe metadata is used to set the `Content-Length`, `Content-Type`, and `Content-Disposition` headers. If not provided, the client will attempt to determine them automatically.\nFor example, `fs.ReadStream` has a `path` property which the SDK uses to retrieve the file size from the filesystem without loading it into memory.\n\n\n## Pagination\n\nList endpoints are paginated. The SDK provides an iterator so that you can simply loop over the items:\n\n```typescript\nimport { SquareClient } from \"square\";\n\nconst client = new SquareClient({ token: \"YOUR_TOKEN\" });\nconst pageableResponse = await client.bankAccounts.list({\n    cursor: \"cursor\",\n    limit: 1,\n    locationId: \"location_id\",\n    customerId: \"customer_id\"\n});\nfor await (const item of pageableResponse) {\n    console.log(item);\n}\n\n// Or you can manually iterate page-by-page\nlet page = await client.bankAccounts.list({\n    cursor: \"cursor\",\n    limit: 1,\n    locationId: \"location_id\",\n    customerId: \"customer_id\"\n});\nwhile (page.hasNextPage()) {\n    page = page.getNextPage();\n}\n\n// You can also access the underlying response\nconst response = page.response;\n```\n\n## Webhook Signature Verification\n\nThe SDK provides utility methods that allow you to verify webhook signatures and ensure that all \nwebhook events originate from Square. The `Webhooks.verifySignature` method will verify the signature.\n\n```ts\nimport { WebhooksHelper } from \"square\";\n\nconst isValid = WebhooksHelper.verifySignature({\n  requestBody,\n  signatureHeader: request.headers['x-square-hmacsha256-signature'],\n  signatureKey: \"YOUR_SIGNATURE_KEY\",\n  notificationUrl: \"https://example.com/webhook\", // The URL where event notifications are sent.\n});\n```\n\n## Advanced\n\n### Additional Headers\n\nIf you would like to send additional headers as part of the request, use the `headers` request option.\n\n```typescript\nimport { SquareClient } from \"square\";\n\nconst client = new SquareClient({\n    ...\n    headers: {\n        'X-Custom-Header': 'custom value'\n    }\n});\n\nconst response = await client.payments.create(..., {\n    headers: {\n        'X-Custom-Header': 'custom value'\n    }\n});\n```\n\n### Additional Query String Parameters\n\nIf you would like to send additional query string parameters as part of the request, use the `queryParams` request option.\n\n```typescript\nconst response = await client.payments.create(..., {\n    queryParams: {\n        'customQueryParamKey': 'custom query param value'\n    }\n});\n```\n\n### Retries\n\nThe SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long\nas the request is deemed retryable and the number of retry attempts has not grown larger than the configured\nretry limit (default: 2).\n\nA request is deemed retryable when any of the following HTTP status codes is returned:\n\n- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)\n- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)\n- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)\n\nUse the `maxRetries` request option to configure this behavior.\n\n```typescript\nconst response = await client.payments.create(..., {\n    maxRetries: 0 // override maxRetries at the request level\n});\n```\n\n### Timeouts\n\nThe SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.\n\n```typescript\nconst response = await client.payments.create(..., {\n    timeoutInSeconds: 30 // override timeout to 30s\n});\n```\n\n### Aborting Requests\n\nThe SDK allows users to abort requests at any point by passing in an abort signal.\n\n```typescript\nconst controller = new AbortController();\nconst response = await client.payments.create(..., {\n    abortSignal: controller.signal\n});\ncontroller.abort(); // aborts the request\n```\n\n### Access Raw Response Data\n\nThe SDK provides access to raw response data, including headers, through the `.withRawResponse()` method.\nThe `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.\n\n```typescript\nconst { data, rawResponse } = await client.payments.create(...).withRawResponse();\n\nconsole.log(data);\nconsole.log(rawResponse.headers['X-My-Header']);\n```\n\n### Logging\n\nThe SDK supports logging. You can configure the logger by passing in a `logging` object to the client options.\n\n```typescript\nimport { SquareClient, logging } from \"square\";\n\nconst client = new SquareClient({\n    ...\n    logging: {\n        level: logging.LogLevel.Debug, // defaults to logging.LogLevel.Info\n        logger: new logging.ConsoleLogger(), // defaults to ConsoleLogger\n        silent: false, // defaults to true, set to false to enable logging\n    }\n});\n```\nThe `logging` object can have the following properties:\n- `level`: The log level to use. Defaults to `logging.LogLevel.Info`.\n- `logger`: The logger to use. Defaults to a `logging.ConsoleLogger`.\n- `silent`: Whether to silence the logger. Defaults to `true`.\n\nThe `level` property can be one of the following values:\n- `logging.LogLevel.Debug`\n- `logging.LogLevel.Info`\n- `logging.LogLevel.Warn`\n- `logging.LogLevel.Error`\n\nTo provide a custom logger, you can pass in an object that implements the `logging.ILogger` interface.\n\n\u003cdetails\u003e\n\u003csummary\u003eCustom logger examples\u003c/summary\u003e\n\nHere's an example using the popular `winston` logging library.\n```ts\nimport winston from 'winston';\n\nconst winstonLogger = winston.createLogger({...});\n\nconst logger: logging.ILogger = {\n    debug: (msg, ...args) =\u003e winstonLogger.debug(msg, ...args),\n    info: (msg, ...args) =\u003e winstonLogger.info(msg, ...args),\n    warn: (msg, ...args) =\u003e winstonLogger.warn(msg, ...args),\n    error: (msg, ...args) =\u003e winstonLogger.error(msg, ...args),\n};\n```\n\nHere's an example using the popular `pino` logging library.\n\n```ts\nimport pino from 'pino';\n\nconst pinoLogger = pino({...});\n\nconst logger: logging.ILogger = {\n  debug: (msg, ...args) =\u003e pinoLogger.debug(args, msg),\n  info: (msg, ...args) =\u003e pinoLogger.info(args, msg),\n  warn: (msg, ...args) =\u003e pinoLogger.warn(args, msg),\n  error: (msg, ...args) =\u003e pinoLogger.error(args, msg),\n};\n```\n\u003c/details\u003e\n\n\n### Runtime Compatibility\n\n\nThe SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following\nruntimes:\n\n\n\n- Node.js 18+\n- Vercel\n- Cloudflare Workers\n- Deno v1.25+\n- Bun 1.0+\n- React Native\n\n### Customizing Fetch Client\n\nThe SDK provides a way for you to customize the underlying HTTP client / Fetch function. If you're running in an\nunsupported environment, this provides a way for you to break glass and ensure the SDK works.\n\n```typescript\nimport { SquareClient } from \"square\";\n\nconst client = new SquareClient({\n    ...\n    fetcher: // provide your implementation here\n});\n```\n\n## Contributing\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically.\nAdditions made directly to this library would have to be moved over to our generation code,\notherwise they would be overwritten upon the next generated release. Feel free to open a PR as\na proof of concept, but know that we will not be able to merge it as-is. We suggest opening\nan issue first to discuss with us!\n\nOn the other hand, contributions to the README are always very welcome!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquare%2Fsquare-nodejs-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquare%2Fsquare-nodejs-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquare%2Fsquare-nodejs-sdk/lists"}