import { PixelbinConfig, PixelbinClient } from "@pixelbin/admin";
export default defineComponent({
props: {
pixelbin: {
type: "app",
app: "pixelbin",
}
},
async run({steps, $}) {
// Creates a Pixelbin config using the API Token
const config = new PixelbinConfig({
domain: "https://api.pixelbin.io",
apiSecret: this.pixelbin.$auth.api_token,
integrationPlatform: "@PipedreamHQ/pipedream v0.1",
});
const pixelbin = new PixelbinClient(config);
const getData = async function() {
try {
// list the assets stored on your organization's Pixelbin Storage
const explorer = pixelbin.assets.listFilesPaginator({
onlyFiles: true,
pageSize: 5,
});
if (explorer.hasNext()) {
return await explorer.next();
}
} catch (err) {
console.log(err);
}
};
//Returns list of assets to use in the Pipedream workflow's downstream steps
return await getData();
},
})
Pixelbin uses API keys for authentication. When you connect your Pixelbin account, Pipedream securely stores the keys so you can easily authenticate to Pixelbin APIs in both code and no-code steps.
To retrieve your API Token and Access Key,