Skip to main content
Go to Latest
File

v5.0.0

Breaking Changes:

  • removed req.cloudflare object entirely.

    you should instead use the req.geo object for geolocation data and req.raw for more full in-depth data about the incoming request.

  • configuration file must be named .darkflare.ts now.

  • Deno is now required instead of Node.js.

    • we’re currently working on an alternative for dependabot.

    • you can still use eslint for linting, but we’re currently trying to find a better solution.

New Features:

  • you can now mention environment variables in your config.

    import { configure } from 'https://deno.gg/darkflare'
    
    export default configure(env => ({
      storage: env.storage
    }))

    but remember: they can only be accessed at runtime and are undefined during build time!

  • Mail class available now

    send a email to one or more people using mailchannels.

  • Webhook class available now

    schedule a webhook with a payload and a optional secret for authentication.

  • UserAgent class available now

    get basic about the user agent of the incoming request, e.g. their browser, device, engine, os, cpu and whether they’re a bot.

  • modules out now!

    • darkflare/cli

      deno install -n darkflare --allow-all https://deno.gg/darkflare@v5.0.0/cli
    • darkflare/realm

      import { Schema } from 'https://deno.gg/darkflare@v5.0.0/realm'
    • darkflare/jwt

      import { jwtSign, jwtDecode, jwtVerify } from 'https://deno.gg/darkflare@v5.0.0/jwt'

      currently a copy of tsndr/cloudflare-worker-jwt.

    • darkflare/types

      an up-to-date copy of cloudflare/workers-types.

      {
        "compilerOptions": {
          "types": [
            "https://deno.gg/darkflare@v5.0.0/types"
          ]
        }
      }

Other Changes:

  • @darkflare/eslint-config is being discontinued for now and might be replaced by our own linter later on.