Skip to content

Commit ac6cd23

Browse files
committed
Fix formatting
1 parent 5d2cd56 commit ac6cd23

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docusaurus/docs/cms/api/client.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ To use the Strapi Client in your project, install it as a dependency using your
5151

5252
To start interacting with your Strapi back end, initialize the Strapi Client and set the base API URL:
5353

54-
With Javascript, require the `strapi` function and create a client instance:
5554
<Tabs groupId="js-ts">
5655
<TabItem value="js" label="JavaScript">
56+
With Javascript, require the `strapi` function and create a client instance:
5757

5858
```js
5959
import { strapi } from '@strapi/client';
@@ -62,9 +62,9 @@ const client = strapi({ baseURL: 'http://localhost:1337/api' });
6262
```
6363
</TabItem>
6464

65+
<TabItem value="ts" label="TypeScript">
6566

6667
With Typescript, import the `strapi` function and create a client instance with your Strapi API base URL:
67-
<TabItem value="ts" label="TypeScript">
6868

6969
```typescript
7070
import { strapi } from '@strapi/client';
@@ -74,18 +74,21 @@ const client = strapi({ baseURL: 'http://localhost:1337/api' });
7474
</TabItem>
7575

7676

77-
If you're using the Strapi Client in a browser environment, you can include it using a `<script>` tag.
7877
<TabItem value="browser" label="Browser (UMD)">
78+
If you're using the Strapi Client in a browser environment, you can include it using a `<script>` tag.
79+
7980
```js title="./src/api/[apiName]/routes/[routerName].ts (e.g './src/api/restaurant/routes/restaurant.ts')"
8081
<script src="https://cdn.jsdelivr.net/npm/@strapi/client"></script>
8182

8283
<script>
8384
const client = strapi.strapi({ baseURL: 'http://localhost:1337/api' });
8485
</script>
8586
```
87+
8688
</TabItem>
8789
The `baseURL` must include the protocol (`http` or `https`). An invalid URL will throw an error `StrapiInitializationError`.
8890

91+
</Tabs>
8992

9093
### Authentication
9194

0 commit comments

Comments
 (0)