Quick start

  1. Create an app

    Sign in to the MediaLit dashboard with your email and create an app. Each app has its own files, settings and API keys. Creating the app shows its first API key. Copy it now: MediaLit shows a key only once. You can create more keys in the app's settings.

    Anyone with the API key can upload, read and delete the app's files. Keep it on your server and out of browser code.

  2. Upload a file

    Pick the way you want to work with MediaLit.

    npm
    npm install -g @medialit/cli
    medialit login
    medialit upload photo.jpg --public

    The CLI seals the file for you, so you can skip the next step. See CLI.

    The response includes a mediaId and a file URL.

  3. Seal it

    The upload is temporary, and MediaLit deletes it after 24 hours unless you seal it. Seal files once you know you want to keep them, for example when the user saves the form they were uploaded from.

    curl -X POST https://api.medialit.cloud/media/seal/MEDIA_ID \
      -H "x-medialit-apikey: YOUR_API_KEY"

    Sealed files appear in listings, in your storage total and in the dashboard. Why uploads are temporary.

Next steps