@@ -83,9 +83,9 @@ pnpm add @strapi/sdk-js
8383To interact with your Strapi backend, initialize the SDK with your Strapi API base URL:
8484
8585``` typescript
86- import { strapiSDK } from ' @strapi/sdk-js' ;
86+ import { strapi } from ' @strapi/sdk-js' ;
8787
88- const sdk = strapiSDK ({ baseURL: ' http://localhost:1337/api' });
88+ const sdk = strapi ({ baseURL: ' http://localhost:1337/api' });
8989```
9090
9191Alternatively, use a ` <script> ` tag in a browser environment:
@@ -94,7 +94,7 @@ Alternatively, use a `<script>` tag in a browser environment:
9494<script src =" https://cdn.jsdelivr.net/npm/@strapi/sdk-js" ></script >
9595
9696<script >
97- const sdk = strapi .strapiSDK ({ baseURL: ' http://localhost:1337/api' });
97+ const sdk = strapi .strapi ({ baseURL: ' http://localhost:1337/api' });
9898 </script >
9999```
100100
@@ -107,7 +107,7 @@ The SDK supports multiple authentication strategies for accessing authenticated
107107If your Strapi instance uses API tokens, configure the SDK like this:
108108
109109``` typescript
110- const sdk = strapiSDK ({
110+ const sdk = strapi ({
111111 baseURL: ' http://localhost:1337/api' ,
112112 auth: {
113113 strategy: ' api-token' ,
@@ -230,25 +230,25 @@ For **browser environments**, debug capabilities are intentionally turned off to
230230The ` debug ` tool allows you to control logs using wildcard patterns (` * ` ):
231231
232232- ` * ` : enable all logs.
233- - ` sdk :module` : enable logs for a specific module.
234- - ` sdk :module1,sdk:module2` : enable logs for multiple modules.
235- - ` sdk :*` : match all namespaces under ` sdk ` .
236- - ` sdk :*,-sdk :module2` : enable all logs except those from ` sdk :module2` .
233+ - ` strapi :module` : enable logs for a specific module.
234+ - ` strapi :module1,sdk:module2` : enable logs for multiple modules.
235+ - ` strapi :*` : match all namespaces under ` strapi ` .
236+ - ` strapi :*,-strapi :module2` : enable all logs except those from ` strapi :module2` .
237237
238238### Namespaces
239239
240240Below is a list of available namespaces to use:
241241
242- | Namespace | Description |
243- | ---------------------------------------| ------------------------------------------------------------------------------------------- |
244- | ` sdk :core` | Logs SDK initialization, configuration validation, and HTTP client setup. |
245- | ` sdk :validators:sdk ` | Logs details related to SDK configuration validation. |
246- | ` sdk :validators:url` | Logs URL validation processes. |
247- | ` sdk :http` | Logs HTTP client setup, request processing, and response/error handling. |
248- | ` sdk :auth:factory` | Logs the registration and creation of authentication providers. |
249- | ` sdk :auth:manager` | Logs authentication lifecycle management. |
250- | ` sdk :auth:provider:api-token` | Logs operations related to API token authentication. |
251- | ` sdk :auth:provider:users-permissions` | Logs operations related to user and permissions-based authentication. |
252- | ` sdk :ct:collection` | Logs interactions with collection-type content managers. |
253- | ` sdk :ct:single` | Logs interactions with single-type content managers. |
254- | ` sdk :utils:url-helper` | Logs URL helper utility operations (e.g., appending query parameters or formatting URLs). |
242+ | Namespace | Description |
243+ | ---------------------------------------- | ----------------------------------------------------------------------------------------- |
244+ | ` strapi :core` | Logs SDK initialization, configuration validation, and HTTP client setup. |
245+ | ` strapi :validators:config ` | Logs details related to SDK configuration validation. |
246+ | ` strapi :validators:url` | Logs URL validation processes. |
247+ | ` strapi :http` | Logs HTTP client setup, request processing, and response/error handling. |
248+ | ` strapi :auth:factory` | Logs the registration and creation of authentication providers. |
249+ | ` strapi :auth:manager` | Logs authentication lifecycle management. |
250+ | ` strapi :auth:provider:api-token` | Logs operations related to API token authentication. |
251+ | ` strapi :auth:provider:users-permissions` | Logs operations related to user and permissions-based authentication. |
252+ | ` strapi :ct:collection` | Logs interactions with collection-type content managers. |
253+ | ` strapi :ct:single` | Logs interactions with single-type content managers. |
254+ | ` strapi :utils:url-helper` | Logs URL helper utility operations (e.g., appending query parameters or formatting URLs). |
0 commit comments