Source plugin for pulling user language data into Gatsby from Duolingo.
npm install --save gatsby-source-duolingo
or
yarn add gatsby-source-duolingo
First, you need a way to pass environment variables to the build process, so secrets and other secured data aren't committed to source control. We recommend using dotenv
which will then expose environment variables. Read more about dotenv and using environment variables here. Then we can use these environment variables and configure our plugin.
// In your gatsby-config.js
module.exports = {
plugins: [
{
resolve: `gatsby-source-duolingo`,
options: {
username: `your_username`,
// Learn about environment variables: https://gatsby.dev/env-vars
identifier: process.env.DUOLINGO_IDENTIFIER,
password: process.env.DUOLINGO_PASSWORD,
},
},
],
};
username
[string][required]
Duolingo username
identifier
[string][required]
Email account used to sign-in to your Duolingo account
password
[string][required]
Password used to sign-in to your Duolingo account
{
allDuolingoLanguage {
edges {
node {
id
language_string
}
}
}
}
export const query = graphql`
{
duolingoLanguage(language: { eq: "zs" }) {
id
language_string
}
}
`;