fixed type and trying to debug issue

This commit is contained in:
FifthWit 2025-04-02 19:43:12 -05:00
parent fe25b07d4f
commit 05bbc4720d
2 changed files with 19 additions and 15 deletions

View file

@ -1,4 +1,4 @@
import { config } from 'dotenv';
import { config } from "dotenv";
config();
import { version } from "./server/utils/config";
//https://nitro.unjs.io/config
@ -11,18 +11,18 @@ export default defineNitroConfig({
runtimeConfig: {
public: {
meta: {
name: process.env.META_NAME || '',
description: process.env.META_DESCRIPTION || '',
version: version || '',
captcha: (process.env.CAPTCHA === 'true').toString(),
captchaClientKey: process.env.CAPTCHA_CLIENT_KEY || ''
}
name: process.env.META_NAME || "",
description: process.env.META_DESCRIPTION || "",
version: version || "",
captcha: (process.env.CAPTCHA === "true").toString(),
captchaClientKey: process.env.CAPTCHA_CLIENT_KEY || "",
},
},
cryptoSecret: process.env.CRYPTO_SECRET,
tmdbApiKey: process.env.TMDB_API_KEY,
trakt: {
clientId: process.env.TRAKT_CLIENT_ID,
clinetSecret: process.env.TRAKT_CLIENT_SECRET,
clientSecret: process.env.TRAKT_CLIENT_SECRET,
},
}
});
},
});

View file

@ -1,10 +1,14 @@
import Trakt from 'trakt.tv';
const traktKeys = useRuntimeConfig().trakt
import Trakt from "trakt.tv";
const traktKeys = useRuntimeConfig().trakt;
if (!traktKeys) {
throw new Error("Missing TraktKeys info ERROR: " + JSON.stringify(traktKeys));
}
const options = {
client_id: traktKeys.clientId,
client_secret: traktKeys.clinetSecret
}
client_secret: traktKeys.clientSecret,
};
const trakt = new Trakt(options);
export default trakt;
export default trakt;