{"id":15498739,"url":"https://github.com/jankapunkt/meteor-remote-collections-provider","last_synced_at":"2026-05-04T02:32:57.702Z","repository":{"id":81102713,"uuid":"76953953","full_name":"jankapunkt/meteor-remote-collections-provider","owner":"jankapunkt","description":"Provides functionality to manage methods, collections and publications for the jokester:remote-collections package.","archived":false,"fork":false,"pushed_at":"2017-02-01T13:50:40.000Z","size":20,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T17:27:04.486Z","etag":null,"topics":["collections","ddp","meteor","methods","publication","remote-connection","subscription"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jankapunkt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-20T12:17:50.000Z","updated_at":"2016-12-20T12:22:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"42a4a290-a3ef-406c-b8b0-44b746903a79","html_url":"https://github.com/jankapunkt/meteor-remote-collections-provider","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jankapunkt/meteor-remote-collections-provider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jankapunkt%2Fmeteor-remote-collections-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jankapunkt%2Fmeteor-remote-collections-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jankapunkt%2Fmeteor-remote-collections-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jankapunkt%2Fmeteor-remote-collections-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jankapunkt","download_url":"https://codeload.github.com/jankapunkt/meteor-remote-collections-provider/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jankapunkt%2Fmeteor-remote-collections-provider/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32592507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collections","ddp","meteor","methods","publication","remote-connection","subscription"],"created_at":"2024-10-02T08:47:29.832Z","updated_at":"2026-05-04T02:32:57.686Z","avatar_url":"https://github.com/jankapunkt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/jankapunkt/meteor-remote-collections-provider.svg?branch=master)](https://travis-ci.org/jankapunkt/meteor-remote-collections-provider)\n[![Code Climate](https://codeclimate.com/github/jankapunkt/meteor-remote-collections-provider/badges/gpa.svg)](https://codeclimate.com/github/jankapunkt/meteor-remote-collections-provider)\n[![Test Coverage](https://codeclimate.com/github/jankapunkt/meteor-remote-collections-provider/badges/coverage.svg)](https://codeclimate.com/github/jankapunkt/meteor-remote-collections-provider/coverage)\n[![Issue Count](https://codeclimate.com/github/jankapunkt/meteor-remote-collections-provider/badges/issue_count.svg)](https://codeclimate.com/github/jankapunkt/meteor-remote-collections-provider)\n\n# jkuester:remote-collections-provider\n\nThis meteor package allows to manage the registration of methods, collections and publications to be used by [jkuester:remote-collections](https://github.com/jankapunkt/meteor-remote-collections) or any other remote application via DDP.\n\n### Usage\n\nThe package is a handy tool, if you want to manage which collections are available to an external app (which may use [jkuester:remote-collections](https://github.com/jankapunkt/meteor-remote-collections)) or a custom DDP based implementation.\n\nThe RemoteCollectionsProvider is a singleton and can be imported and initialized via:\n\n```javascrit\nimport {RemoteCollectionsProvider} from \"meteor/jkuester:remote-collections-provider\";\nRemoteCollectionsProvider.init();\n```\n\nYour remote application requires some information, to successfully get your collections:\n* What method can it call to get a list of available collections (their names)\n* What method can it call to get a list of available subscriptions (their names)\n\nTherefore you first need to add your collections to the list of available collection:\n\n```javascript\nRemoteCollectionsProvider.addCollectionNames('myMongoCollection'); //pass the name, you passed to the Mongo.Collection constructor\n```\n\nThen you need to add your publications (you do not need to call Meteor.publish, it does this for you, too).\n\n```javascript\nRemoteCollectionsProvider.addPublication('myCollection.public', function(){\n    return myCollection.find({}); //your code here\n});\n```\n\nFinally you need to provide two methods, which allows your external app to retrieve the lists of available collections and subscriptions:\n\n```javascript\n\n//ake all collection names available\nRemoteCollectionsProvider.addMethod(\n    \"ddp.getAvailableRemoteMethods\",\n    function(){\n        //returns a list of all available publications\n        return RemoteCollectionsProvider.getAllCollectionNames();\n    },\n    //use true to call Meteor.methods(...) on this immediatly\n    //you can also use false to bundle and the call RemoteCollectionsProvider.applyAllMethods()\n    true\n);\n\n\n//make all subscription names available\nRemoteCollectionsProvider.addMethod(\n    \"ddp.getAvailableRemotePublications\",\n    function(){\n        //returns a list of all available publications\n        return RemoteCollectionsProvider.getAllPublicationNames();\n    },\n    true\n);\n```\n\nIn your external application you can consume these functions via\n\n```javascript\nconst remote = DDP.connect(yourProviderAppUrl);\n//...\n\nconst remoteCollections = remote.call(\"ddp.getAvailableRemoteMethods\");\nfor(let collection of remoteCollections)\n    //add collection...\n\nconst remotePublications = remote.call(\"ddp.getAvailableRemotePublications\");\nfor(let publication of remotePublications)\n    //subscribe...\n\n```\n\n### Licence\n\nMIT Licence, see Licence file","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjankapunkt%2Fmeteor-remote-collections-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjankapunkt%2Fmeteor-remote-collections-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjankapunkt%2Fmeteor-remote-collections-provider/lists"}