Skip to content

Basic

The smallest complete setup: register the module, set your shortname, and render a thread with <DisqusComments />.

1. Register the module and set your shortname

Section titled “1. Register the module and set your shortname”
nuxt.config.ts
export default defineNuxtConfig({
modules: ['nuxt-disqus'],
disqus: {
shortname: 'your-disqus-shortname',
},
})
pages/blog/[id].vue
<script setup lang="ts">
const route = useRoute()
</script>
<template>
<article>
<h1>My blog post</h1>
<p>...post content...</p>
<DisqusComments :identifier="`/blog/${route.params.id}`" />
</article>
</template>

That’s it. The thread loads lazily when it scrolls into view, using the shortname from your config. <DisqusComments /> is auto-imported, so there’s no import statement.

If you want Disqus to record the canonical URL alongside the identifier, pass url:

<template>
<DisqusComments
identifier="/blog/1"
url="https://example.com/blog/1"
/>
</template>