### Installing Segment Public API SDK with Yarn Source: https://github.com/segmentio/public-api-sdk-typescript/blob/master/README.md This command installs the Segment Public API TypeScript SDK using Yarn, an alternative package manager for Node.js. It adds the SDK as a dependency to your project, enabling its use in your application. ```Shell yarn add @segment/public-api-sdk-typescript ``` -------------------------------- ### Installing Segment Public API SDK with npm Source: https://github.com/segmentio/public-api-sdk-typescript/blob/master/README.md This command installs the Segment Public API TypeScript SDK using npm, the default package manager for Node.js. It adds the SDK as a dependency to your project, allowing you to import and use its functionalities. ```Shell npm i @segment/public-api-sdk-typescript ``` -------------------------------- ### Fetching Workspace Details using Segment Public API SDK Source: https://github.com/segmentio/public-api-sdk-typescript/blob/master/README.md This TypeScript example demonstrates how to initialize the Segment Public API SDK with an authentication token and then fetch details of the current workspace. It uses 'configureApis' to set up the client and 'unwrap' to handle the promise, logging the result or any errors. ```TypeScript import * as PublicAPI from '@segment/public-api-sdk-typescript'; const TOKEN = '...'; // fetch your token from a secure location const { workspaces } = PublicAPI.configureApis(TOKEN); // To access the EU endpoint, use `const { workspaces } = PublicAPI.configureEuApis(TOKEN)` PublicAPI.unwrap(workspaces.getWorkspace()) .then((result) => { console.log(JSON.stringify(result)); }) .catch(console.error); ``` -------------------------------- ### Building Segment Public API SDK from Source Source: https://github.com/segmentio/public-api-sdk-typescript/blob/master/README.md These commands install project dependencies and then compile the TypeScript SDK from its source code. This process generates JavaScript files in the 'dist/' directory, useful for local development or custom builds. ```Shell yarn install yarn build ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.