https://www.ory.sh/ logo
#talk-kratos
Title
# talk-kratos
b

boundless-hydrogen-45841

10/27/2021, 8:11 AM
still it is throwing the same error.
b

blue-state-12403

10/27/2021, 8:13 AM
🤔 what version is your package? I have it workign with said line
b

boundless-hydrogen-45841

10/27/2021, 8:15 AM
it is undefined right
in my case it is undefined but in my used case it is showing that it is a constructor
b

blue-state-12403

10/27/2021, 8:17 AM
Its just a "namespace"
b

boundless-hydrogen-45841

10/27/2021, 8:18 AM
const kratos = new PublicApi(new Configuration({ basePath: 'http://127.0.0.1:4433' }));
how can I used it in this case
*use
@blue-state-12403
b

blue-state-12403

10/27/2021, 8:25 AM
sorry i do not know for sure, im just another customer. But if you look at the secureapp, directly from ory, they do it like this: https://github.com/ory/kratos-selfservice-ui-node/blob/master/src/pkg/sdk/index.ts
i just wanted to help fix the import error 🙈
b

boundless-hydrogen-45841

10/27/2021, 8:28 AM
its ok man.
Thanks!
b

blue-state-12403

10/27/2021, 8:31 AM
ha!
message has been deleted
tada 🙂
Copy code
import PublicApi, {Configuration} from '@ory/kratos-client';


const api = new PublicApi.V0alpha2Api(new Configuration({
    basePath: '<http://example.org>',
}));
or just
Copy code
import {Configuration, V0alpha2Api} from '@ory/kratos-client';


const api = new V0alpha2Api(new Configuration({
    basePath: '<http://example.org>',
}));
b

boundless-hydrogen-45841

10/27/2021, 8:51 AM
TypeError: Cannot read properties of undefined (reading 'V0alpha2Api')
throwing this error
now its working thanks!
b

blue-state-12403

10/27/2021, 9:04 AM
glad I could help 🙂
🙌 1
7 Views