---
title: Ajouter des handlers personnalisés
slug: oip-next/iWtI-ajouter-des-handlers-a-processhandlers
icon: {"lucideIcon":"📘"}
createdAt: 2025-12-18T17:30:36.000Z
---

Il est également possible d'ajouter des handlers personnalisés à `processHandlers` (hook `useProcess`) grâce à la propriété `customHandlers` de la fonction `start` côté client.

Les handlers ajoutés seront alors accessibles de la même manière que les handlers natifs depuis n'importe quel composant d'une vue de votre projet.

Exemple :

:::CodeblockTabs
index.jsx

```javascript
import { start } from '@fasstech/oip-starter-utils/app';

const myCustomHandler = () => {
  // some logic
};

const myOtherCustomHandler = () => {
  // some logic
};

// Init client app
(() => {
  start({
    customHandlers: { myCustomHandler, myOtherCustomHandler },
    // ...
  });
})();
```

MyView\.jsx

```javascript
import { useEffect } from 'react';
import { useProcess } from '@fasstech/oip-starter-utils/app';

const MyView = () => {
  const { processHandlers } = useProcess();
  
  useEffect(() => {
    processHandlers.myOtherCustomHandler();
  }, []);

  const onMyCustomHandler = () => {
    processHandlers.myCustomHandler();
  };

  return (
    <div>
      <h2>DEMO</h2>

      <button onClick={onMyCustomHandler}>
        TRIGGER MY CUSTOM HANDLER
      </button>
    </div>
  );
};
```
:::
