Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
gatsby-source-dropbox
Advanced tools
Source plugin for getting data from Dropbox account.
npm install --save gatsby-source-dropbox
Configure the plugin
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-source-dropbox`,
options: {
accessToken: `access-token`,
extensions: ['.pdf', '.jpg', '.png', '.md'],
path: '/path/to/folder',
recursive: false,
createFolderNodes: false,
},
},
]
createFolderNodes: false
The plugin provides some basic information of the remote files such as:
The plugin makes use of the create remote node API of gatsby to locally download all the files in order to use them with other transformer plugins such as gatsby-transformer-sharp for images or gatsby-transformer-remark for markdown files.
Example:
query {
allDropboxNode {
edges {
node {
id
name
lastModified
path
localFile {
childMarkdownRemark {
html
}
}
}
}
}
}
createFolderNodes: true
By setting this to true, you will get the following types in graphql:
allDropboxFolder
allDropboxImage
allDropboxMarkdown
allDropboxNode # everything that's not one of the above, will be of this type
You can now easily query for files within a folder. Lets say you have a simple portfolio structured like this on your dropbox:
.
+-- Project-01-Lorem-Name
| +-- Description.md
| +-- Gallery-Image-01.jpg
| +-- Gallery-Image-02.jpg
+-- Project-02-Ipsum-Name
| +--Description.md
| +--Gallery-Image-01.jpg
| +--Gallery-Image-02.jpg
You can now query like following in gatsby-node.js
and create project pages with a corresponding template:
query MyQuery {
allDropboxFolder(filter: {name: {regex: "/Project/"}}) {
group(field: name) {
nodes {
name
dropboxImage {
localFile {
childImageSharp {
fluid {
src
}
}
}
}
dropboxMarkdown {
localFile {
childMarkdownRemark {
html
}
}
}
}
}
}
}
FAQs
Gatsby source plugin for creating nodes from dropbox API
The npm package gatsby-source-dropbox receives a total of 2 weekly downloads. As such, gatsby-source-dropbox popularity was classified as not popular.
We found that gatsby-source-dropbox demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.