> For the complete documentation index, see [llms.txt](https://docs.opinion.trade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opinion.trade/developer-guide/opinion-clob-typescript-sdk/builder-mode/get-user.md).

# Get User

> Query user information or regenerate API credentials.

## Get User

```typescript
import { BuilderClient } from '@opinion-labs/opinion-clob-sdk';

const builder = new BuilderClient({
  host: 'https://openapi.opinion.trade/openapi',
  builderApiKey: 'YOUR_BUILDER_KEY',
  chainId: 56,
});

const user = await builder.getUser('0xUserWalletAddress...');

console.log(user.walletAddress);    // User's login wallet address
console.log(user.multiSigWallet);   // User's Gnosis Safe wallet address
console.log(user.builderName);      // Builder name
console.log(user.enableTrading);    // Whether trading is enabled
```

### Parameters

| Parameter       | Type   | Required | Description                             |
| --------------- | ------ | -------- | --------------------------------------- |
| `walletAddress` | string | Yes      | User's EOA wallet address (0x-prefixed) |

### Response

Returns `UserInfo` without `apikey` or `walletCreationTxHash` (omitted for security).

```typescript
{
  walletAddress: string;
  multiSigWallet: string;
  builderName: string;
  enableTrading: boolean;
}
```

## Regenerate API Key

Invalidate the old API key and generate a new one.

```typescript
const result = await builder.regenerateUserApiKey('0xUserWalletAddress...');

console.log(result.apikey);  // New API key - SAVE THIS!
```

### Parameters

| Parameter       | Type   | Required | Description                             |
| --------------- | ------ | -------- | --------------------------------------- |
| `walletAddress` | string | Yes      | User's EOA wallet address (0x-prefixed) |

### Response

Returns full `UserInfo` including the new `apikey`.

## Notes

* `getUser()` does **not** return the API key for security reasons.
* The new API key from `regenerateUserApiKey()` is returned only once. Store it securely.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.opinion.trade/developer-guide/opinion-clob-typescript-sdk/builder-mode/get-user.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
