|
1 | | -# Client TypeScript SDK 0.1.0 |
| 1 | +# `@magicbell/project-client` |
2 | 2 |
|
3 | | -Welcome to the Client SDK documentation. This guide will help you get started with integrating and using the Client SDK in your project. |
| 3 | +This package is deprecated. Please use [`magicbell-js`](https://www.magicbell.com/docs/libraries/magicbell-js) instead. Migrating is as simple as updating your import statements. |
4 | 4 |
|
5 | | -[](https://liblab.com/?utm_source=readme) |
| 5 | +```diff |
| 6 | +- import { Client } from '@magicbell/project-client'; |
| 7 | ++ import { Client } from 'magicbell-js/project-client'; |
6 | 8 |
|
7 | | -## Versions |
| 9 | +const client = new Client({ |
| 10 | + token: 'YOUR_TOKEN', |
| 11 | +}); |
8 | 12 |
|
9 | | -- API version: `2.0.0` |
10 | | -- SDK version: `0.1.0` |
| 13 | +const { data } = await client.broadcasts.listBroadcasts({ |
| 14 | + limit: 3, |
| 15 | + startingAfter: 'starting_after', |
| 16 | + endingBefore: 'ending_before', |
| 17 | +}); |
11 | 18 |
|
12 | | -## About the API |
13 | | - |
14 | | -OpenAPI 3.1.0 Specification for MagicBell API. |
15 | | - |
16 | | -## Table of Contents |
17 | | - |
18 | | -- [Setup & Configuration](#setup--configuration) |
19 | | - - [Supported Language Versions](#supported-language-versions) |
20 | | - - [Installation](#installation) |
21 | | -- [Authentication](#authentication) |
22 | | - - [Access Token Authentication](#access-token-authentication) |
23 | | -- [Setting a Custom Timeout](#setting-a-custom-timeout) |
24 | | -- [Sample Usage](#sample-usage) |
25 | | -- [Services](#services) |
26 | | -- [Models](#models) |
27 | | - |
28 | | -# Setup & Configuration |
29 | | - |
30 | | -## Supported Language Versions |
31 | | - |
32 | | -This SDK is compatible with the following versions: `TypeScript >= 4.8.4` |
33 | | - |
34 | | -## Installation |
35 | | - |
36 | | -To get started with the SDK, we recommend installing using `npm`: |
37 | | - |
38 | | -```bash |
39 | | -npm install @magicbell/project-client |
| 19 | +console.log(data); |
40 | 20 | ``` |
41 | | - |
42 | | -## Authentication |
43 | | - |
44 | | -### Access Token Authentication |
45 | | - |
46 | | -The Client API uses an Access Token for authentication. |
47 | | - |
48 | | -This token must be provided to authenticate your requests to the API. |
49 | | - |
50 | | -#### Setting the Access Token |
51 | | - |
52 | | -When you initialize the SDK, you can set the access token as follows: |
53 | | - |
54 | | -```ts |
55 | | -const sdk = new Client({ token: 'YOUR_TOKEN' }); |
56 | | -``` |
57 | | - |
58 | | -If you need to set or update the access token after initializing the SDK, you can use: |
59 | | - |
60 | | -```ts |
61 | | -const sdk = new Client(); |
62 | | -sdk.token = 'YOUR_TOKEN'; |
63 | | -``` |
64 | | - |
65 | | -## Setting a Custom Timeout |
66 | | - |
67 | | -You can set a custom timeout for the SDK's HTTP requests as follows: |
68 | | - |
69 | | -```ts |
70 | | -const client = new Client({ timeout: 10000 }); |
71 | | -``` |
72 | | - |
73 | | -# Sample Usage |
74 | | - |
75 | | -Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint: |
76 | | - |
77 | | -```ts |
78 | | -import { Client } from '@magicbell/project-client'; |
79 | | - |
80 | | -(async () => { |
81 | | - const client = new Client({ |
82 | | - token: 'YOUR_TOKEN', |
83 | | - }); |
84 | | - |
85 | | - const { data } = await client.broadcasts.listBroadcasts({ |
86 | | - limit: 6, |
87 | | - startingAfter: 'starting_after', |
88 | | - endingBefore: 'ending_before', |
89 | | - }); |
90 | | - |
91 | | - console.log(data); |
92 | | -})(); |
93 | | -``` |
94 | | - |
95 | | -## Services |
96 | | - |
97 | | -The SDK provides various services to interact with the API. |
98 | | - |
99 | | -<details> |
100 | | -<summary>Below is a list of all available services with links to their detailed documentation:</summary> |
101 | | - |
102 | | -| Name | |
103 | | -| :--------------------------------------------------------------------- | |
104 | | -| [BroadcastsService](documentation/services/BroadcastsService.md) | |
105 | | -| [ChannelsService](documentation/services/ChannelsService.md) | |
106 | | -| [EventsService](documentation/services/EventsService.md) | |
107 | | -| [IntegrationsService](documentation/services/IntegrationsService.md) | |
108 | | -| [JwtService](documentation/services/JwtService.md) | |
109 | | -| [NotificationsService](documentation/services/NotificationsService.md) | |
110 | | -| [UsersService](documentation/services/UsersService.md) | |
111 | | - |
112 | | -</details> |
113 | | - |
114 | | -## Models |
115 | | - |
116 | | -The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently. |
117 | | - |
118 | | -<details> |
119 | | -<summary>Below is a list of all available models with links to their detailed documentation:</summary> |
120 | | - |
121 | | -| Name | Description | |
122 | | -| :----------------------------------------------------------------------------------- | :---------- | |
123 | | -| [BroadcastCollection](documentation/models/BroadcastCollection.md) | | |
124 | | -| [Broadcast](documentation/models/Broadcast.md) | | |
125 | | -| [Links](documentation/models/Links.md) | | |
126 | | -| [CategoryDeliveryConfig](documentation/models/CategoryDeliveryConfig.md) | | |
127 | | -| [InboxTokenResponseCollection](documentation/models/InboxTokenResponseCollection.md) | | |
128 | | -| [InboxTokenResponse](documentation/models/InboxTokenResponse.md) | | |
129 | | -| [Links](documentation/models/Links.md) | | |
130 | | -| [DiscardResult](documentation/models/DiscardResult.md) | | |
131 | | -| [ApnsTokenCollection](documentation/models/ApnsTokenCollection.md) | | |
132 | | -| [ApnsToken](documentation/models/ApnsToken.md) | | |
133 | | -| [ExpoTokenCollection](documentation/models/ExpoTokenCollection.md) | | |
134 | | -| [ExpoToken](documentation/models/ExpoToken.md) | | |
135 | | -| [FcmTokenCollection](documentation/models/FcmTokenCollection.md) | | |
136 | | -| [FcmToken](documentation/models/FcmToken.md) | | |
137 | | -| [SlackTokenCollection](documentation/models/SlackTokenCollection.md) | | |
138 | | -| [SlackToken](documentation/models/SlackToken.md) | | |
139 | | -| [TeamsTokenCollection](documentation/models/TeamsTokenCollection.md) | | |
140 | | -| [TeamsToken](documentation/models/TeamsToken.md) | | |
141 | | -| [WebPushTokenCollection](documentation/models/WebPushTokenCollection.md) | | |
142 | | -| [WebPushToken](documentation/models/WebPushToken.md) | | |
143 | | -| [EventCollection](documentation/models/EventCollection.md) | | |
144 | | -| [Event](documentation/models/Event.md) | | |
145 | | -| [Links](documentation/models/Links.md) | | |
146 | | -| [IntegrationConfigCollection](documentation/models/IntegrationConfigCollection.md) | | |
147 | | -| [IntegrationConfig](documentation/models/IntegrationConfig.md) | | |
148 | | -| [Links](documentation/models/Links.md) | | |
149 | | -| [ApnsConfigCollection](documentation/models/ApnsConfigCollection.md) | | |
150 | | -| [ApnsConfig](documentation/models/ApnsConfig.md) | | |
151 | | -| [ApnsConfigPayload](documentation/models/ApnsConfigPayload.md) | | |
152 | | -| [AwssnsConfigCollection](documentation/models/AwssnsConfigCollection.md) | | |
153 | | -| [AwssnsConfig](documentation/models/AwssnsConfig.md) | | |
154 | | -| [AwssnsConfigPayload](documentation/models/AwssnsConfigPayload.md) | | |
155 | | -| [EventSourceConfigCollection](documentation/models/EventSourceConfigCollection.md) | | |
156 | | -| [EventSourceConfig](documentation/models/EventSourceConfig.md) | | |
157 | | -| [EventSourceConfigPayload](documentation/models/EventSourceConfigPayload.md) | | |
158 | | -| [ExpoConfigCollection](documentation/models/ExpoConfigCollection.md) | | |
159 | | -| [ExpoConfig](documentation/models/ExpoConfig.md) | | |
160 | | -| [ExpoConfigPayload](documentation/models/ExpoConfigPayload.md) | | |
161 | | -| [FcmConfigCollection](documentation/models/FcmConfigCollection.md) | | |
162 | | -| [FcmConfig](documentation/models/FcmConfig.md) | | |
163 | | -| [FcmConfigPayload](documentation/models/FcmConfigPayload.md) | | |
164 | | -| [GithubConfigCollection](documentation/models/GithubConfigCollection.md) | | |
165 | | -| [GithubConfig](documentation/models/GithubConfig.md) | | |
166 | | -| [GithubConfigPayload](documentation/models/GithubConfigPayload.md) | | |
167 | | -| [InboxConfigCollection](documentation/models/InboxConfigCollection.md) | | |
168 | | -| [InboxConfig](documentation/models/InboxConfig.md) | | |
169 | | -| [InboxConfigPayload](documentation/models/InboxConfigPayload.md) | | |
170 | | -| [MailgunConfigCollection](documentation/models/MailgunConfigCollection.md) | | |
171 | | -| [MailgunConfig](documentation/models/MailgunConfig.md) | | |
172 | | -| [MailgunConfigPayload](documentation/models/MailgunConfigPayload.md) | | |
173 | | -| [PingConfigCollection](documentation/models/PingConfigCollection.md) | | |
174 | | -| [PingConfig](documentation/models/PingConfig.md) | | |
175 | | -| [PingConfigPayload](documentation/models/PingConfigPayload.md) | | |
176 | | -| [SendgridConfigCollection](documentation/models/SendgridConfigCollection.md) | | |
177 | | -| [SendgridConfig](documentation/models/SendgridConfig.md) | | |
178 | | -| [SendgridConfigPayload](documentation/models/SendgridConfigPayload.md) | | |
179 | | -| [SesConfigCollection](documentation/models/SesConfigCollection.md) | | |
180 | | -| [SesConfig](documentation/models/SesConfig.md) | | |
181 | | -| [SesConfigPayload](documentation/models/SesConfigPayload.md) | | |
182 | | -| [SlackConfigCollection](documentation/models/SlackConfigCollection.md) | | |
183 | | -| [SlackConfig](documentation/models/SlackConfig.md) | | |
184 | | -| [SlackConfigPayload](documentation/models/SlackConfigPayload.md) | | |
185 | | -| [StripeConfigCollection](documentation/models/StripeConfigCollection.md) | | |
186 | | -| [StripeConfig](documentation/models/StripeConfig.md) | | |
187 | | -| [StripeConfigPayload](documentation/models/StripeConfigPayload.md) | | |
188 | | -| [TemplatesConfigCollection](documentation/models/TemplatesConfigCollection.md) | | |
189 | | -| [TemplatesConfig](documentation/models/TemplatesConfig.md) | | |
190 | | -| [TwilioConfigCollection](documentation/models/TwilioConfigCollection.md) | | |
191 | | -| [TwilioConfig](documentation/models/TwilioConfig.md) | | |
192 | | -| [TwilioConfigPayload](documentation/models/TwilioConfigPayload.md) | | |
193 | | -| [WebpushConfigCollection](documentation/models/WebpushConfigCollection.md) | | |
194 | | -| [WebpushConfig](documentation/models/WebpushConfig.md) | | |
195 | | -| [WebpushConfigPayload](documentation/models/WebpushConfigPayload.md) | | |
196 | | -| [AccessTokenCollection](documentation/models/AccessTokenCollection.md) | | |
197 | | -| [AccessToken](documentation/models/AccessToken.md) | | |
198 | | -| [Links](documentation/models/Links.md) | | |
199 | | -| [CreateProjectTokenRequest](documentation/models/CreateProjectTokenRequest.md) | | |
200 | | -| [CreateTokenResponse](documentation/models/CreateTokenResponse.md) | | |
201 | | -| [DiscardTokenResponse](documentation/models/DiscardTokenResponse.md) | | |
202 | | -| [DeliveryPlanCollection](documentation/models/DeliveryPlanCollection.md) | | |
203 | | -| [DeliveryPlan](documentation/models/DeliveryPlan.md) | | |
204 | | -| [Links](documentation/models/Links.md) | | |
205 | | -| [UserCollection](documentation/models/UserCollection.md) | | |
206 | | -| [User](documentation/models/User.md) | | |
207 | | -| [Links](documentation/models/Links.md) | | |
208 | | - |
209 | | -</details> |
0 commit comments