npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nuxt-flarum

v1.1.6

Published

A Nuxt module for Flarum integration

Readme

nuxt-flarum

npm version

A Nuxt module for Flarum SSO.

Setup

The setup process includes stages for both Nuxt.js and Flarum.

Configure Nuxt.js

Install with npm:

npm install @nuxtjs/flarum

Update nuxt.config.js:

module.exports = {
  modules: [
    '@nuxtjs/flarum',
  ],

  flarum: {
    url: 'https://discuss.example.com',
    sessionCookieDomain: '.example.com',
    apiKey: 'master-api-key',
    salt: 'random-secret-string'
  }
}

Configure Flarum

Create a random token and put it in the api_keys table of your Flarum database.

Install flarum-ext-sso:

composer require wuethrich44/flarum-ext-sso

Activate the extension and fill in the redirect URLs for login, signup and logout.

Configure the server (options for Apache shown):

# Set headers
Header always set Access-Control-Allow-Origin "https://www.example.com"
Header always set Access-Control-Allow-Credentials true
Header always set Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS"
Header always set Access-Control-Allow-Headers "Origin, Content-Type, Authorization, Set-Cookie"

# Return a 200 response for OPTIONS requests
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]

Once the server is restarted, SSO should be enabled.

Usage

<template>
  <main>
    <input v-model="username">
    <input v-model="email">
    <input v-model="password">
    <button @click="signin">Signin</button>
    <button @click="signout">Signout</button>
  </main>
</template>

<script>
  export default {
    data: {
      username: null,
      email: null,
      password: null
    },

    methods: {
      signin () {
        this.$flarum.signin(this.username, this.email)
      },

      signout () {
        this.$flarum.signout()
      }
    }
  }
</script>

Users are resolved by email address. If no user can be found with an email address that matches one passed in flarum.signin() then a new user will be created.

This means that if the user updates their email address in your main application this update should also be passed to Flarum. Otherwise, when the user next visits the Flarum site a new account created for them (using their new email address). Here's an example of a function that can be used to update a current user's email address:

updateEmail(oldEmail, newEmail) {
  return this.$flarum.getUserByEmail(oldEmail).then(flarumUser => {
    if (flarumUser) {
      this.$flarum.updateUser(flarumUser.id, {
        email: newEmail
      })
    }
  }).catch(err => {
    this.$nuxt.error(err)
  })
}