Skip to content
API
Authentication

API Authentication

Every request to Plunk's API needs to be authenticated with the public or secret key associated with your project. You can find these keys in the API settings of your project.

👋🏼

Only use your secret key in a secure, backend environment. Never expose your secret key to the public. In case you do, regenerate your secret key immediately.

Once you have your key, you can authenticate your requests by passing it as a Bearer token in the Authorization header.

await fetch('https://api.useplunk.com/v1', {
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        "Authorization": "Bearer API_KEY", // Put your API key here
    },
    body: JSON.stringify({
        "event": "new-project",
        "email": "hello@useplunk.com",
    }),
});