Easly add custom discord widgets to your website.
Via NPM:
$ npm install discord-widget --save
Via Yarn (recommended):
$ yarn add discord-widget
import Widget from "discord-widget";
(async function () {
await Widget.init(
document.querySelector("#my-widget-container"),
"server-id"
);
})();
if you are not using any bundlers
<script src="dist/discord-widget.js"></script>
<script>
(async function () {
await DiscordWidget.init(
document.querySelector("#my-widget-container"),
"server-id"
);
})();
</script>
import Widget from "discord-widget";
const container = document.querySelector("#my-widget-container")
(async function () {
await Widget.init(container, "600381707073486871");
//Use it if you want to disable default styles and use your own
Widget.detachStyle();
})()
Copyright © 2021 Jakub Szołtysek.
This project is MIT licensed.