Back to Templates

Protecting your Symfony routes

Quickstart for Symfony

Written by
utkarshml
Framework
Symfony
Language
PHP
Quickstart for Symfony

Unkey Symfony Template

This Symfony template demonstrates how to integrate Unkey to protect API routes. Unkey enables easy API key management and route protection.

Features

  • Create API Keys: Generate API keys for your users.
  • Get API Key Information: Retrieve information for a specific API key.
  • Protected Routes: Restrict access to certain routes using Unkey API key verification.

Installation

Prerequisites

  • PHP 8.1 or higher
  • Composer
  • Symfony CLI

Clone the repository

1git clone https://github.com/utkarshml/unkey_symfony.git
2cd unkey-symfony

Install dependencies

1composer install

Set up environment variables

In your .env file, set the necessary Unkey API credentials:

1UNKEY_API_KEY=your_unkey_api_key
2UNKEY_BASE_URL=https://api.unkey.com

Replace your_unkey_api_key with your actual Unkey API key.

Demo Video

Demo Video of Unkey

Protect your API.
Start today.

2500 verifications and 100K successful rate‑limited requests per month. No CC required.