eluv-io / elv-live-js

Eluvio Live JavaScript SDK
MIT License
4 stars 3 forks source link

Add NTP sample #168

Closed elv-serban closed 7 months ago

elv-serban commented 7 months ago

Code sample showing:

elv-todd commented 7 months ago

seems to be missing things:

$ node samples/NtpSample.js
NEW NTP QOTPSq4aBkiGvjN
CODES [
  { token: '2GDq6F', user_id: 'iusr2cAqH2VYUZLtNFVebL1Mtwn3dT5b' },
  { token: 'WiwTET', user_id: 'iusr2ZtYebWKEhR4KQedXjzW3rWwYmp7' }
]
EMBED URLS [
  'https://embed.v3.contentfabric.io/?p=&net=demo&oid=iq__2dZdRdqPNQqd7TRuAMNVcTUQ9Mah&ct=h',
  'https://embed.v3.contentfabric.io/?p=&net=demo&oid=iq__2dZdRdqPNQqd7TRuAMNVcTUQ9Mah&ct=h'
]
...
elv-sam commented 7 months ago

Hm, yes that output has the same embed URLs for all 4..?

Nitpick but are "codes2" and "urls2" clear enough? I don't know if we have a convention

elv-todd commented 7 months ago

ah, this depends on an updated elv-client-js PR: Extend EmbedUrl to support ticket codes (#260)

once i had that dependency right, eg, npm link ../elv-client-js, the URLs look better

NEW NTP QOTPXcDrH8vQdxv
CODES [
  { token: 'A721Zm', user_id: 'iusr2W8umBVtbPy2zWrFBfPhxmgSHFox' },
  { token: 'EwN5hh', user_id: 'iusr2jnwbktacaNP9fmhKuCVuy5WTjEU' }
]
EMBED URLS [
  'https://embed.v3.contentfabric.io/?p=&net=demo&oid=iq__2dZdRdqPNQqd7TRuAMNVcTUQ9Mah&mt=v&ptk=&ten=iten4TXq2en3qtu3JREnE5tSLRf9zLod&ntp=QOTPXcDrH8vQdxv&tk=QTcyMVpt&ct=h',
  'https://embed.v3.contentfabric.io/?p=&net=demo&oid=iq__2dZdRdqPNQqd7TRuAMNVcTUQ9Mah&mt=v&ptk=&ten=iten4TXq2en3qtu3JREnE5tSLRf9zLod&ntp=QOTPXcDrH8vQdxv&tk=RXdONWho&ct=h'
]

but give 500

OTP def 'QOTPXcDrH8vQdxv' does not exist for tenant 'iten4TXq2en3qtu3JREnE5tSLRf9zLod'

looking into it

elv-serban commented 7 months ago

The sample deletes the OTP at the end. So the URLs are invalidated. To test the URLs, comment out the deletion line!