@segment/public-api-sdk-typescript 34.2.0-b5873 → 34.2.0-b5886
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,20 +40,17 @@ You are now ready to start making calls to Public API!
|
|
|
40
40
|
## Example
|
|
41
41
|
|
|
42
42
|
```typescript
|
|
43
|
-
import * as
|
|
43
|
+
import * as PublicAPI from '@segment/public-api-sdk-typescript'
|
|
44
44
|
|
|
45
|
-
const TOKEN = //
|
|
45
|
+
const TOKEN = '...' // fetch your token from a secure location
|
|
46
46
|
|
|
47
|
-
const
|
|
48
|
-
|
|
47
|
+
const { workspaces } = PublicAPI.configureApis(TOKEN)
|
|
48
|
+
PublicAPI.unwrap(workspaces.getWorkspace())
|
|
49
49
|
.then((result) => {
|
|
50
|
-
console.log(
|
|
50
|
+
console.log(JSON.stringify(result))
|
|
51
51
|
})
|
|
52
|
-
.catch(
|
|
53
|
-
console.log("ERROR\n:", error)
|
|
54
|
-
}
|
|
52
|
+
.catch(console.error)
|
|
55
53
|
)
|
|
56
|
-
|
|
57
54
|
```
|
|
58
55
|
|
|
59
56
|
## Contributing
|