{"action":"created","issue":{"url":"https://api.github.com/repos/ericelliott/cuid/issues/54","labels_url":"https://api.github.com/repos/ericelliott/cuid/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/ericelliott/cuid/issues/54/comments","events_url":"https://api.github.com/repos/ericelliott/cuid/issues/54/events","html_url":"https://github.com/ericelliott/cuid/issues/54","id":117290635,"number":54,"title":"Usage in react-native","user":{"login":"deanmcpherson","id":2773950,"avatar_url":"https://avatars.githubusercontent.com/u/2773950?v=3","gravatar_id":"","url":"https://api.github.com/users/deanmcpherson","html_url":"https://github.com/deanmcpherson","followers_url":"https://api.github.com/users/deanmcpherson/followers","following_url":"https://api.github.com/users/deanmcpherson/following{/other_user}","gists_url":"https://api.github.com/users/deanmcpherson/gists{/gist_id}","starred_url":"https://api.github.com/users/deanmcpherson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deanmcpherson/subscriptions","organizations_url":"https://api.github.com/users/deanmcpherson/orgs","repos_url":"https://api.github.com/users/deanmcpherson/repos","events_url":"https://api.github.com/users/deanmcpherson/events{/privacy}","received_events_url":"https://api.github.com/users/deanmcpherson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-17T06:14:22Z","updated_at":"2015-11-19T02:04:59Z","closed_at":null,"body":"More of a comment here for other react-native users that might run into the same issue, than a bug specifically, but because react-native doesn't provide a userAgent or mimeTypes by default, using cuid will throw an error.\r\n\r\nThis can be worked around by defining dummy values before requiring cuid;\r\n```js\r\nglobal.navigator.mimeTypes = ''; //browser-fingerprint only checks the length property so an empty string is fine\r\nglobal.navigator.userAgent = 'reactnative';\r\n```\r\n\r\nI did try using the node version but rn also doesn't set a process.pid so runs into the same issue."},"comment":{"url":"https://api.github.com/repos/ericelliott/cuid/issues/comments/157923919","html_url":"https://github.com/ericelliott/cuid/issues/54#issuecomment-157923919","issue_url":"https://api.github.com/repos/ericelliott/cuid/issues/54","id":157923919,"user":{"login":"deanmcpherson","id":2773950,"avatar_url":"https://avatars.githubusercontent.com/u/2773950?v=3","gravatar_id":"","url":"https://api.github.com/users/deanmcpherson","html_url":"https://github.com/deanmcpherson","followers_url":"https://api.github.com/users/deanmcpherson/followers","following_url":"https://api.github.com/users/deanmcpherson/following{/other_user}","gists_url":"https://api.github.com/users/deanmcpherson/gists{/gist_id}","starred_url":"https://api.github.com/users/deanmcpherson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deanmcpherson/subscriptions","organizations_url":"https://api.github.com/users/deanmcpherson/orgs","repos_url":"https://api.github.com/users/deanmcpherson/repos","events_url":"https://api.github.com/users/deanmcpherson/events{/privacy}","received_events_url":"https://api.github.com/users/deanmcpherson/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T02:04:59Z","updated_at":"2015-11-19T02:04:59Z","body":"Hey Eric,\r\n\r\nAccording to https://github.com/facebook/react-native/issues/1331 it looks like there is no idiomatic way of detecting the react native environment yet, though once there is it should be pretty easy to get some form of unique device id."}}