# Migration v32

Contains no breaking changes, but is step 1 out of 2 to seamlessly transfer to use Gateway for some of the User services.

## What do you need to do?

1: At the time of writing you can't issue this key automatically - ask in `#api-gateway-support` for keys (for prod and test env). You will need to tell them if you want the `User Profile Creation (api.ft.com/idm/v1/users/create)` or/and `User Profile (api.ft.com/idm/v1/users/{userId}/profile)`. Someone should be able to issue them manually for you. Make it clear you need a SYSTEM key, and name the system you're requesting the keys for.

2: Add these in your system's vault folders as `USER_CREATION_GATEWAY_KEY_{ENV}` and `USER_PROFILE_GATEWAY_KEY_{ENV}` respectively. Check all the vault folders and add these as necessary (so if your dev folder only has the old TEST env key, you only need to add the new TEST env key)

3: In the membership config file in the consumer app add to Production Config `userCreationGatewayApiKey: process.env.USER_CREATION_GATEWAY_KEY_PROD` and to the Test Config `userCreationGatewayApiKey: process.env.USER_CREATION_GATEWAY_KEY_TEST`. You also will need to add to Production Config `userProfileUpdateApiKey: process.env.USER_PROFILE_GATEWAY_KEY_PROD` and to the Test Config `userProfileUpdateApiKey: process.env.USER_PROFILE_GATEWAY_KEY_TEST`

4: If your CI uses the env vars, you will need to add them to the relevant file (`cypress/plugins/setup.js` in`next-retention`).

5: Make sure you're consuming the SDK patch that updates the `createProfile` gateway URL to end with `/create`.

## Changes

`src/user.ts` - two methods - `createProfile` and `updateProfile` have a ternary set up: if the gateway key is available, it will send the call thorugh the gateway.

A later release will remove this conditional so that only the Gateway setup remains. Although this is a two-step process, it will allow a stress free migration to the new keys.
