Creating a meteor package out of my meteor application

I have a meteor application which deals with fetching API from third party. I need to create a package out of my meteor application or maybe convert the meteor application into a package so that meteor developers can use it by just adding the package into their application.
I looked online and found that you needed to create a meteor developer account but when I clicked on the link, it seems to be outdated.
Is there a way I can do this ?

https://accounts.meteor.com/auth/dialog?state=eyJsb2dpblN0eWxlIjoicmVkaXJlY3QiLCJjcmVkZW50aWFsVG9rZW4iOiJmd0lueVZnVk1Fc3Rvc1BqTGVydGgwYzRiakpyaHBuVWZnbDE4RzdtcWROIiwiaXNDb3Jkb3ZhIjpmYWxzZSwicmVkaXJlY3RVcmwiOiJodHRwczovL2dhbGF4eS1iZXRhLm1ldGVvci5jb20vbG9naW4ifQ==&response_type=code&client_id=vyimmmxvL8wxN6cs2&details={}#

That link above looks like having user session ids

@abroa01

a) Install directly from GitHub

You can install npm packages directly from GitHub. It is not required to publish at atmospherejs.com or npmjs.com . Also, npm packages can be used with any Javascript web framework, not only Meteor.

For example, this installs package from GitHub:

npm install github:wekan/dragscroll --save

It can be used it like this at client:

import dragscroll from 'dragscroll';

Or moved to run at server:

Repo for that is here:

https://github.com/wekan/dragscroll

package.json looks like this:

{
  "dependencies": {
    "@wekanteam/dragscroll": "github:wekan/dragscroll"
  }
}

b) Publish at npmjs.com

  1. Register here:
  1. At command line, login to npm:
npm login

More info about that is at:

  1. At your package directory, publish your public package:
npm publish --access public

Settings

For settings, you can use serverside environment variables, like this:

const someSetting=process.env.SOME_SETTING;

You can copy serverside variable to clientside, if needed:

and use it at clientside, for example like this:

  onRendered() {
    if (Meteor.settings.public.SOME_SETTING) {

Here is example, how I added that environment variable to many platforms:

1 Like

@abroa01 you need a Meteor account in order to publish the package to the public.

However you also create the package and share e.g. via GitHub repo without a Meteor account.