Back to Templates

Secure Your Media Library with Unkey

Invite others to view and contribute to your collection while ensuring that only authorized users have access to your valuable digital content.

Written by
unrenamed
Framework
Nuxt
Language
Typescript
Invite others to view and contribute to your collection while ensuring that only authorized users have access to your valuable digital content.

Secure Your Media Library with Unkey

This templates utilizes Unkey's API to secure your media library with time-sensitive API keys. Invite others to view and contribute to your collection while ensuring that only authorized users have access to your valuable digital content.

Features

  • ๐Ÿ“ท Image upload and display with hubBlob()
  • ๐Ÿ–ผ๏ธ Image Filters: Apply a variety of filters to your images.
  • ๐Ÿ’พ Saving: Save your images with applied filters.
  • ๐ŸŒ Cloud Storage: Blob powered by NuxtHub (cloudflare R2).
  • ๐ŸŽ  Custom Carousel: Includes a custom carousel component that can be adapted for in-house use.
  • ๐Ÿƒ๐Ÿป View transition API The View Transitions API provides a mechanism for easily creating animated transitions between different DOM states while also updating the DOM contents in a single step.
  • ๐Ÿ”‘ Nuxt Auth Utils Minimalist Authentication module for Nuxt exposing Vue composables and server utils combined with Unkey for securing and generating temporary access to your API at any scale.

Stack

Getting started

Create a Unkey Root Key

  1. Navigate to Unkey Root Keys and click "Create New Root Key".
  2. Name your root key.
  3. Select the following workspace permissions:
    • create_key
    • read_key
    • encrypt_key
    • decrypt_key
  4. Click "Create" and save your root key securely.

Create a Unkey API

  1. Go to Unkey APIs and click "Create New API".
  2. Enter a name for the API.
  3. Click "Create".

Generate your first API Key

This step is required only once for the first user. You can generate additional keys for other users from within the app.

  1. From the Unkey APIs page, select your newly created API.
  2. Click "Create Key" in the top right corner.
  3. In Meta section add this JSON:
    1{ "role": "contributor" }
  4. Click "Create" and copy the generated key. You'll use it on your first login.

Setup

  1. Clone this repository to your local machine.
  2. Install dependencies using the command pnpm install or your favorite package manager.
  3. Run the application with the command pnpm dev or your favorite package manager.

If you don't have pnpm installed, run: corepack enable pnpm

Environment Variables

Create a .env file in the root directory and populate it with the following environment variables:

1NUXT_UNKEY_ROOT_KEY=your-unkey-root-key
2NUXT_UNKEY_API_ID=your-unkey-api-id

Ensure you replace your-unkey-* with your actual Unkey credentials.

Development

1pnpm dev

Remote Storage

Once you deployed your project, you can connect to your remote database locally running:

1pnpm dev --remote

Deploy

You can deploy this project on your Cloudflare account for free and with zero configuration using NuxtHub.

1npx nuxthub deploy

It's also possible to leverage Cloudflare Pages CI for deploying, learn more about the different options on https://hub.nuxt.com/docs/getting-started/deploy

Learn more about remote storage on https://hub.nuxt.com/docs/getting-started/remote-storage

Protect your API.
Start today.

2500 verifications and 100K successful rateโ€‘limited requests per month. No CC required.