{"id":13578076,"url":"https://github.com/SyncProxy/sync-client","last_synced_at":"2025-04-05T15:32:21.922Z","repository":{"id":217509196,"uuid":"133366011","full_name":"SyncProxy/sync-client","owner":"SyncProxy","description":"SyncProxy javascript client with support for all major embedded databases (IndexedDB, SQLite, WebSQL, LokiJS...)","archived":false,"fork":false,"pushed_at":"2020-12-03T16:57:38.000Z","size":1156,"stargazers_count":43,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-05T15:49:10.620Z","etag":null,"topics":["app","database","embedded-database","indexeddb","ionic","localstorage","mobile","mongodb","mysql","nosql","offline","reactive-sync","reactivity","sql","sql-server","sqlite","sqlserver","sync-client","synchronization","websql"],"latest_commit_sha":null,"homepage":"https://www.syncproxy.com","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/SyncProxy.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}},"created_at":"2018-05-14T13:37:10.000Z","updated_at":"2024-04-23T11:41:31.000Z","dependencies_parsed_at":"2024-01-16T23:31:22.816Z","dependency_job_id":"83db017c-f252-4615-837b-9f00ca20df7b","html_url":"https://github.com/SyncProxy/sync-client","commit_stats":null,"previous_names":["syncproxy/sync-client"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncProxy%2Fsync-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncProxy%2Fsync-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncProxy%2Fsync-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncProxy%2Fsync-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SyncProxy","download_url":"https://codeload.github.com/SyncProxy/sync-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247359394,"owners_count":20926413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["app","database","embedded-database","indexeddb","ionic","localstorage","mobile","mongodb","mysql","nosql","offline","reactive-sync","reactivity","sql","sql-server","sqlite","sqlserver","sync-client","synchronization","websql"],"created_at":"2024-08-01T15:01:27.084Z","updated_at":"2025-04-05T15:32:16.913Z","avatar_url":"https://github.com/SyncProxy.png","language":"JavaScript","readme":"# Introduction\nSyncProxy-client is a javascript client for SyncProxy that enables one-single line of code implementation of synchronization for javascript offline applications using embedded database (IndexedDB, SQLite, SQLJS, WebSQL, LokiJS...). Used with the SyncProxy server (https://www.syncproxy.com) to access the backend database (MySQL, SQL Server, MongoDB...), this is the shortest way to make mobile offline applications synchronize bi-directionally in realtime using reactive sync technology.\n\n# Installation\n```\n$ git clone https://github.com/syncproxy/sync-client\n```\n# Example\nSimply copy the library, then load the SyncProxy client script from within your main index.html page:\n\n```html\n\u003cscript src=\"sync-client/sync-client.js\" proxyID=\"\u003cproxy Id\u003e\" connectorType=\"IndexedDB / WebSQL / SQLite / SQLJS / IonicStorage\" dbName=\"your client db name\"\u003e\u003c/script\u003e \n```\n\n(the script params can also be retrieved directly from https://my.syncproxy.com when creating a sync proxy)\n\n## Custom params\nSync client script can be invoked with custom params that are inserted as attributes of the **\u0026lt;script\u0026gt;** tag:\n\n**src (mandatory)**  \npath to the client sync script (recommended: \"client-sync/client-sync.js\")\n\n**proxyID (mandatory)**  \nId attributed by SyncProxy to  your proxy on creation\n\n**connectorType**  \nvalues: \"IndexedDB\", \"WebSQL\", \"SQLite\", \"SQLJS\", \"LocalStorage\", \"IonicStorage\", \"LokiJS\"\ndefault: \"IndexedDB\"\n\n**dbName**  \nName of your embedded database in mobile app.  \ndefault: \"SyncProxy\"\n\n**protocol**  \nvalues: \"ws\" (websocket) or \"wss\" (secured websoket)  \ndefault: \"wss\"\n\n**serverUrl**  \nUrl of the server hosting SyncProxy  \ndefault: \"my.syncproxy.com\"\n\n**serverPort**  \nPort listened on by SyncProxy server  \ndefault value: 4501\n\n**autoUpgradeDB**  \nvalues: \"true\", \"false\"\nIf true, the embedded database's structure will be automatically upgraded (if this is relevant to the type of database) during sync after a database schema update.\nSet to false if application creates and upgrades database schema by itself.  \ndefault: \"true\"\n\n**physicalSchemaReadDelay**  \nDelay after which, if no sync schema was found, the sync client will try to read the schema from the physical data store (if this is relevant to the type of database).\nIf set to \"0\", the schema is not read from the physical data store.  \ndefault: \"5000\"\n\n**autoInit**  \nvalues: \"true\", \"false\"\nIf true, sync client will be started automatically. If false, sync client should be created by calling SyncClient.initClient(params)  \ndefault: \"true\"\n\n**reactiveSync**  \nvalues: \"true\", \"false\"\nIf true, enables reactive sync. Reactivity for each table + direction (server-\u003eclient and client-\u003eserver) is configured on server side  \ndefault: \"true\n\n**syncButton**  \nvalues: \"true\", \"fixed\", \"false\"\nIf true, a draggable popup sync button is displayed. If fixed, button's position is fixed. If false, application must take care to launch sync by itself  \ndefault: \"true\"\n\n**tablesToSync**  \nWhen using Auto Backendless database or NoSQL database without server database schema, you have the ability to discover schema from client's data. In that case, attribute tablesToSync must be set with the list of tables to sync from client to server. \ndefault: \"\"\n\n**customCredentials**  \nIf set, defines a custom credential function. Typically returns a {login, password} object which will be sent as-is to the server. If left blank, the credentials are managed by sync client using a login prompt.  \ndefault: \"\"\n\n**loginSource**  \nIf set, defines a user login source object within the application, for instance: \"document.getElementById('inputLogin').value\"  \ndefault: \"\"\n\n**passwordSource**  \nIf set, defines a user password source object within the application, for instance: \"document.getElementById('inputPassword').value\"  \ndefault: \"\"\n\n**zipData**  \nvalues: \"true\", \"false\"\nIf true, server will be requested to send data changes as zipped JSON, otherwise plain JSON.  \ndefault: \"true\"\n\n**welcomeMessage**  \nMessage that will popup in the app before the first synchronization.  \ndefault: \"To begin, please press Sync button\"\n\n**utcDates**\nvalues: \"true\", \"false\"  \nIf true (default), all datetimes will be stored as ISO-8601 strings, otherwise as \"YYYY-MM-DD HH:MI:SS\" (without timezone information).  \ndefault: \"true\"\n\n**onServerChanges(data)**  \nOptional handler function called each time a chunk of data is received from server. Received data are passed as a parameter.\n\n**onSyncEnd**  \nOptional handler function called each time synchronization ends\n\n**useSessionStorage**  \nvalues: \"true\", \"false\"  \nIf true, use the sessionStorage in replacement of the localStorage (for testing purposes)  \nDefault: \"false\"\n\n## Testing\nLike us, test your mobile and progressive web apps with\n\n[\u003cimg src=\"https://raw.githubusercontent.com/syncproxy/sync-client/master/browserstack.png\" width=\"300px\"\u003e](http://www.browserstack.com)\n\n## Documentation\nRead our tutorial on how to setup SyncProxy client with an Ionic hybrid mobile application\nhttps://github.com/syncproxy/syncproxy-quickstart-ionic\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSyncProxy%2Fsync-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSyncProxy%2Fsync-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSyncProxy%2Fsync-client/lists"}