-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ESM url in v2-sdk readme & remove mention to access_token in v2
- Loading branch information
Showing
10 changed files
with
332 additions
and
412 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/content/docs/ko/v2-payment/_components/sdk-installation.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import Tab from "~/components/gitbook/tabs/Tab.astro"; | ||
import Tabs from "~/components/gitbook/tabs/Tabs.astro"; | ||
import Hint from "~/components/Hint.astro"; | ||
import * as prose from '~/components/prose'; | ||
|
||
export const components = prose; | ||
|
||
포트원 V2 SDK는 npm 레지스트리와 CDN을 통해 배포되고 있습니다. | ||
|
||
- npm, yarn 등 패키지 매니저를 사용한다면 의존 | ||
대상으로 [@portone/browser-sdk](https://www.npmjs.com/package/@portone/browser-sdk)를 추가하세요. | ||
|
||
- 패키지 매니저를 사용하지 않는다면 `<script>` 요소를 이용하여 CDN에서 SDK를 직접 불러오세요. | ||
|
||
- CDN에서 ESM 모듈 형태로도 SDK를 제공하고 있습니다. | ||
|
||
<Tabs> | ||
<Tab title="패키지 의존 대상으로 추가"> | ||
사용하는 패키지 매니저에 알맞은 명령어를 실행하세요. | ||
|
||
```shell | ||
npm i @portone/browser-sdk | ||
``` | ||
|
||
```shell | ||
yarn add @portone/browser-sdk | ||
``` | ||
|
||
```shell | ||
pnpm add @portone/browser-sdk | ||
``` | ||
|
||
패키지 매니저로 SDK를 불러온 경우 `PortOne` 객체를 import해서 사용합니다. | ||
|
||
```javascript | ||
import * as PortOne from "@portone/browser-sdk/v2"; | ||
``` | ||
</Tab> | ||
|
||
<Tab title="<script> 요소로 추가"> | ||
```html | ||
<script src="https://cdn.portone.io/v2/browser-sdk.js"></script> | ||
``` | ||
|
||
`<script>` 요소로 SDK를 불러온 경우 전역 객체 `window`에 `PortOne` 객체가 추가됩니다. | ||
</Tab> | ||
|
||
<Tab title="ESM 모듈로 추가"> | ||
ESM 모듈을 사용하는 경우 URL에서 `PortOne` 객체를 직접 import할 수 있습니다. | ||
|
||
```javascript | ||
import * as PortOne from "https://cdn.portone.io/v2/browser-sdk.esm.js"; | ||
``` | ||
</Tab> | ||
</Tabs> | ||
|
||
<Hint style="info"> | ||
**타입스크립트 지원** | ||
|
||
포트원 V2 SDK는 타입스크립트 선언 파일(`.d.ts`)의 형식으로 타입 정보를 제공하고 있습니다. npm 레지스트리를 이용하는 경우 각종 개발 환경에서 별도 설정 없이 사용 가능합니다. | ||
</Hint> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.