-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2 SDK readme에 ESM 설명 복붙 & V2 API Secret 발급 안내에 access token 관련 내용 제거 #357
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 return 안 하면 아래 fetch 실행되는 모양이 될 것 같은데.... 아마 파싱 에러 때문이었을 것 같은데
function requestPayment(){...}
로 코드 감싸면 어떨까요?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그렇네요 ㅎㅎ 반영했습니다