> For the complete documentation index, see [llms.txt](https://docs.thewalletcrew.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thewalletcrew.io/connectors/fr/custom-connector/reference-de-script-des-connecteurs-personnalises/validation-de-compte.md).

# Validation de compte

Validez un compte avant qu’il ne soit créé ou vérifié, à l’aide de \`runtime.scriptable.scriptableAccountValidator\`.

Les appels de Wallet Crew `runtime.scriptable.scriptableAccountValidator` lors de la validation d’un compte, avant qu’il ne soit créé ou vérifié. Cela ne nécessite aucune configuration supplémentaire — il suffit d’enregistrer le point de terminaison dans un script pour qu’il soit appelé.

```js
/**
 * @typedef {Object} ErrorDetail
 * @property {string} Detail - Description lisible par un humain de l’échec de validation.
 * @property {string} [Field] - Nom de champ facultatif auquel l’erreur se rapporte.
 */

/**
 * @param {Record<string, any>} account - L’entité de compte en cours de validation.
 * @returns {Promise<ErrorDetail[]>} Un tableau vide (ou rien) signifie que le compte est valide.
 */
async function validate(account) {
  const errors = [];

  if (!account["email"]) {
    errors.push({ Detail: "L’e-mail est requis", Field: "email" });
  }

  return errors;
}

export default function (context) {
  context.register('runtime.scriptable.scriptableAccountValidator', {
    Validate: validate
  });
}
```

Retourner un tableau vide (ou un tableau sans aucune entrée) signifie que le compte passe la validation. Chaque entrée d’un tableau non vide est considérée comme un échec de validation distinct, avec un `Field` pour l’associer à une entrée spécifique.


---

# 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.thewalletcrew.io/connectors/fr/custom-connector/reference-de-script-des-connecteurs-personnalises/validation-de-compte.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.
