-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cozy.client.init() for client-side apps #150
Comments
Hi,
You can find a real life example here. Hope that helps! Edit: we've updated the documentation :-) |
Thank you for your rapidity, This works well apparently, but when I try to put or get docs in the DB Did you understand this issue ? Sorry for wasting your time |
@e-morel I guess you serve your web app from another domain than the cozy back-end (aka cozy-stack).
|
I serve my app through the script : cozy-app-dev.sh |
And what's the domain you request to get your to your app? Is that |
If you can check your code base and replace |
I modified the host in the script to 'cozy.tools:8080' |
With couchdb in "admin party" mode it seems work. |
That was a trap, unfortunately when I try to define an Index, |
Just to be sure: when you get this error, your browser is pointing to http://app.cozy.tools:8080/, correct? CSPs are added by the stack when the page is served, but they shouldn't prevent you from making calls to |
Yes, exactly http://app.cozy.tools:8080/ |
My problem is maybe caused by couchDB But in Fauxton, I got this error And finally I would like to know, if I put a document in the db with my own docType, where did this document will go ? In which database ? Thank you |
Hello @e-morel, Regarding the There one database per doctype, so if you create a doctype mydoc.emorel.org on server emorel.cozy.tools, documents will be stored in database emorel.cozy.tools/org.emorel.mydoc (replace / by %2F in URL to access it in Fauxton). |
Thank you this part is really more clear now. About this issue : Any idea ? If this is caused by my app, I don't know how because I did the more simple app I can do, to avoid problems. I put the link to the repo in case of someone find something strange. PS : I'm novice with Cozy, you will probably find mistakes, sorry for that |
Hello @e-morel, Wasn't easy, but I found it, at last: when initializing the library, you have to pass it the url sheme. So, use |
Hello @e-morel, Did the fix of the URL sheme worked? |
Hello, |
To get the URL of your server, cozy-bar uses by convention the |
I will try this, thanks again ! |
Errors are disappeared, but the request to get apps |
Could you show us your code? How do you call this API? Are you sending the |
It seems to be a problem with the To be more specific, the request return |
Your code should look something like this:
|
If I do the request by myself like with your code, she return me I don't know if I'm clear. |
I think I get it. cozy-bar get the token by itself in your index page, and assume the attribute is named Thanks for your feedback, this really help us improve our tools. |
Yes it works, thanks My two problems was caused by Thank you for your quick support |
Thanks! I've updated this doc |
Hi,
I'm developing a client-side app for cozy V3 using cozy-client-js.
In the doc, cozy.client.init() use OAuth 2 but i have read in the Auth doc's, that for client-side apps cozy don't use OAuth 2 so I'm a bit lost.
In https://github.com/cozy/cozy-stack/blob/master/docs/client-app-dev.md cozy.init() only use the cozyURL and the token but how I can do it with cozy.client.init().
I don't know if I'm clear, but if someone can help me. Thank you in advance for your answers.
The text was updated successfully, but these errors were encountered: