npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@8base/file-manager

v1.0.13

Published

This package provides a simple tool for uploading files to a server or a custom s3 AWS service. Related with [8base](https://8base.com/)

Downloads

51

Readme

8base-file-manager

This package provides a simple tool for uploading files to a server or a custom s3 AWS service. Related with 8base

Installation

You can install the package via yarn | npm:

yarn add @8base/file-manager
npm install @8base/file-manager --save

Usage

1- Import the package using the following snippet when you want to use it in your project.

import { FileInput } from '@8base/file-manager';

2- Create a new instance of the FileManager class and pass an object with the required configuration parameters. The available options are:

| Option | Type | Description | | :-------- | :------- | :--------------------------------------------------------- | | apiKey | string | Your 8base API key, can be found in your profile | | workspace | number | The workspace id of the app you want to upload files to | | environment | string | the environment id, if you don't know it, by default is 'Master' (default: https://api-eu-west-1.graph.8base.com/v0) | | useFilestack | boolean | Set this option to true if you want to use filestack as a storage provider | | useS3 | boolean | Set this option to true if you want to use AWS S3 service as a storage provider (default: false) | | maxFiles | string | Number of files that can be uploaded at once | | value | string | value for the input field | | onChange | function | callback function when file is selected |

3- You must have a apollo provider in your app.jsx or index.jsx to use this package:

const API_TOKEN = 'xxxxxxx-xxxx-xxxx-xxxx-xxxx'

// Create a middleware that adds the API token to the request headers
const authLink = setContext((_, { headers }) => {
  return {
    headers: {
      ...headers,
      authorization: API_TOKEN ? `Bearer ${API_TOKEN}` : '',
    },
  };
});

const httpLink = createHttpLink({
  uri: `https://api.8base.com/<your-workspace-id>`,
});

const client = new ApolloClient({
  link: authLink.concat(httpLink),
  cache: new InMemoryCache(),
});

ReactDOM.render(
  <React.StrictMode>
    <ApolloProvider client={ client }>
      <App />
    </ApolloProvider>
  </React.StrictMode>,
  document.getElementById('root')
);

Important Notes

  • You must pass the apiKey to your app in order for this package to work.
  • You must configure first on your 8base backend workspace the settings related with the storage provider you want to use (see below).
    • If you don't have any workspace, create one and then go to the settings page and add a new app service:
    • File Storage