Skip to content

Commit

Permalink
Merge pull request #78 from microcmsio/docs/self-hosting
Browse files Browse the repository at this point in the history
ファイルの利用方法の案内の整備
  • Loading branch information
himorishige authored Apr 24, 2024
2 parents fe3eff5 + 3cf2143 commit 765bc9c
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ It helps you to use microCMS from JavaScript and Node.js applications.

### Install

Install npm package.
#### Node.js

> [!IMPORTANT]
> v3.0.0 or later requires Node.js **v18 or higher**.
Install npm package.

```bash
$ npm install microcms-js-sdk
Expand All @@ -21,17 +20,32 @@ or
$ yarn add microcms-js-sdk
```

> [!WARNING]
> The hosting service (unpkg.com) is not related to microCMS. For production use, we recommend self-hosting on your own server.
> [!IMPORTANT]
> v3.0.0 or later requires Node.js **v18 or higher**.
#### Browser(Self-hosting)

Download and unzip `microcms-js-sdk-x.y.z.tgz` from the [releases page](https://github.com/microcmsio/microcms-js-sdk/releases). Then, host it on any server of your choice and use it. The target file is `./dist/umd/microcms-js-sdk.js`.

```html
<script src="https://unpkg.com/[email protected]/dist/umd/microcms-js-sdk.js"></script>
<script src="./microcms-js-sdk.js"></script>
```

#### Browser(CDN)

Please load and use the URL provided by an external provider.

```html
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/microcms-js-sdk.min.js"></script>

or

<script src="https://unpkg.com/microcms-js-sdk@latest/dist/umd/microcms-js-sdk.js"></script>
<script src="https://cdn.jsdelivr.net/npm/microcms-js-sdk/dist/umd/microcms-js-sdk.min.js"></script>
```

> [!WARNING]
> The hosting service (unpkg.com) is not related to microCMS. For production use, we recommend self-hosting on your own server.
### How to use

First, create a client.
Expand Down

0 comments on commit 765bc9c

Please sign in to comment.