# 마이그레이션 가이드

1. **KAS 가입, 인증 키 생성**: KAS를 사용하기 위해서는 사용자 가입 및 API 인증 키 생성이 필요합니다. 자세한 내용은 [KAS 가입, 인증, 권한, SDK 설치](https://ground-x.gitbook.io/kas-docs-dev/getting-started/get-ready)를 참고하세요. 주의) 이렇게 생성한 인증 키를 Front End 코드에 바로 넣어서 사용하는 것은 보안상 매우 위험합니다. 접근이 제한된 Backend 서버에서 사용하십시오.
2. **기존 코드에 인증키 추가**: KAS의 모든 API는 HTTP를 통해 요청할 수 있습니다. 이 때 각 호출은 헤더에 인증 정보를 포함하여야 합니다. Caver.js를 사용한다면 다음과 같은 형태로 호출할 수 있습니다.

   ```
   const accessKeyId = "{{your_accessKeyId}}";
   const secretAccessKey = "{{your_secretAccessKey}}";

   const option = {
      headers: [
        {name: 'Authorization', value: 'Basic ' +  Buffer.from(accessKeyId + ':' + secretAccessKey).toString('base64')},
        {name: 'x-chain-id', value: '8217'},
      ]
   }
   const caver = new Caver(new Caver.providers.HttpProvider("https://node-api.klaytnapi.com/v1/klaytn", option))
   ```
3. **기존에 사용하던 키 이전**: 별도의 사용자별 Wallet이 아닌 EN을 키스토어로 사용한 경우라면, 기존에 사용하던 키의 마이그레이션이 필요할 수 있습니다. KAS에서 기존 키를 사용하기 위해서는 별도의 Wallet API를 사용하여야 하며 Wallet API에는 기존 키의 마이그레이션을 위한 API가 존재합니다. <support@klaytnapi.com> 으로 연락 주세요.
4. **추가적인 코드 수정**: KAS는 일반 EN이 제공하는 JSON RPC API 중 제공되지 않는 것들이 있습니다. 혹시라도 이런 API를 사용하고 계신다면 해당하는 API를 다른 방식으로 수정해야 할 필요가 있을 수 있습니다. JSON RPC의 지원 여부를 확인하고자 하시는 경우 [JSON-RPC API](https://ground-x.gitbook.io/kas-docs-dev/tutorial/klaytn-node-api#tutorial-node-api-support-list)를 참고하세요.

그 외 진행 중 문제가 있거나 궁금한 점이 있는 경우는 KAS 포럼, 또는 <support@klaytnapi.com> 으로 문의 주시기 바랍니다.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ground-x.gitbook.io/kas-docs-dev/getting-started/migrate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
