> ## Documentation Index
> Fetch the complete documentation index at: https://docs.degroshi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Local development

> How to build and test an integration on your own computer: a separate key, webhooks through a tunnel, test and repeated events.

The easiest place to try and test an integration is the [sandbox](https://docs.degroshi.com/en/developers/sandbox.md): a space of made-up data
that you can reset to its starting data. An ordinary `dg_pat_` key works with the real data of your spaces. Here’s how
to build an integration on your computer without breaking anything.

## A key for development

* Create a separate key just for development and keep it in the `DEGROSHI_API_KEY` environment variable, not in the
  code. The SDKs read that variable themselves.
* While you write reads, give the key “Read only” access: it can’t change anything.
* Try writes in the [sandbox](https://docs.degroshi.com/en/developers/sandbox.md) with a `dg_test_` key: nothing there matters, and
  `POST /v1/sandbox/reset` before each test run brings the starting data back.
* When you’re done, revoke the key: [Revoke a key](https://docs.degroshi.com/en/developers/authentication.md#revoke-a-key).

## Webhooks to your computer

A webhook goes only to a public HTTPS address, not to a server running on your computer. A tunnel gives that server a
public address. For example, ngrok for a server on port 3000 (Cloudflare Tunnel works the same way):

```bash theme={null}
ngrok http 3000
```

The tunnel prints a public HTTPS address. Add it, with your handler’s path, as a webhook in “Settings” › “For
developers” › “Webhooks” › “Add webhook” and click “Send test event”. A test event has `"test": true` and shows up on
the “Deliveries” tab marked “Test”.

A free tunnel’s address may change every time it starts: update it with “Edit” next to the URL on the webhook’s page, or
use a tunnel with a fixed address.

## Checking the signature

Check `Degroshi-Signature` on your computer too, with the same `dg_whsec_…` secret: then your handler behaves the same on
the server. How: [Checking the signature](https://docs.degroshi.com/en/developers/webhooks.md#checking-the-signature).

## Repeat an event

* “Send again” on the “Deliveries” tab sends the same event again: handy while you fix your handler.
* `GET /v1/events` returns the last 30 days of events in the same shape as the webhook. You can save them and use them
  as examples in your tests. What each event looks like is in the API reference, under “Webhooks”.

## Limits

A development key has the same request limits as any other: [Rate limits](https://docs.degroshi.com/en/developers/limits.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.